Cognos Analytics

 View Only
  • 1.  Chart Markers - position the marker on the X axis

    Posted Sat October 17, 2020 11:17 AM
    Hi All,

    Is it possible to position dynamically a marker on the X axis? I tried many many things, but I'm failing for the moment.
    The vertical positioning (Y axis) is correct. When setting the marker, I used "Query Calculation" for the property "Numeric Position", and the result is correct.
    I'm happy also as I can display dynamic values in the text / label of the marker.
    BUT: how do I manage to dynamically set the position of this marker on the X axis ?
    When setting the marker, I have the property "Category position", which can be set to Layout Calculation, Category Index, or Percent on Axis.
    Category Index or Percent on Axis are not very interesting to me as it would be completely static, which is the contrary of what I would expect.
    Now, Layout Calculation... I'm not able to get anything working here. Either I have an error, or it is not displayed, or it is displayed for each date of the time axis.
    Do you have an example / a "real" practical example of how it could be set ?

    Many thanks in advance :)

    ------------------------------
    Cosme POUSSET
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Chart Markers - position the marker on the X axis

    Posted Mon October 19, 2020 04:00 AM
    Hi Cosme.
    Just pick 'Layout calculation' for the category position. In the Report expression type in the expression for the markers. for example: [qReport].[DateOfAxis] = [qReport].[DateWithMarker]
    Where [qReport] is the query for your report. Create the queryitem [DateWithMarker] in your query. An finally make sure the type of the two queryitems are identical. So an explicit cast for both queryitems could be necessary. Like: cast ([DateWithMarker]; date)

    ------------------------------
    Thomas van der Meer
    ------------------------------



  • 3.  RE: Chart Markers - position the marker on the X axis

    Posted Mon October 19, 2020 06:16 AM
    Hi Thomas,

    Thanks for your answer, this led me to the solution.
    Initially, I think I tried something equivalent, but with no success. The reason why it was not working is the following:
    . For the time axis / X axis, I'm using an item which is not a date, but varchar. It is sending values like "Jan-20, Feb-20, Mar-20...etc.." Then, it is sorted with a data item which contains dates. When I tried the report expression, I was comparing dates with dates, but it was not working for the marker in the graph, as the data item used for the X axis is not a date...
    Now that it is modified, it is working perfectly.

    Thanks a lot ! It was very important for me currently...

    ------------------------------
    Cosme POUSSET
    ------------------------------