4 Replies Latest reply: Feb 28, 2013 5:41 AM by Erik Videsson RSS

    Limit date values on continuous x-axis

      I'm having a problem with a bar/line chart that shows 2 expressions by month.

      Since the original document has more than 24 months, i want to limit it in a way that only the last 6 months will be displayed in the chart.

      The only way i found to achieve that is to check the option "continuous" in the "Axes" dialogue because then it is possible to define "Static Min/Max" values.

      The problem is, if I do so, other date values, that does not exist in my data are being displayed as well and that the bar is somehow cut off strangely (see attached example file).


      Does anyone have an idea of how to set that up correctly so that only the last 2 Months are displayed in the chart?

      And how can I use the "static step" field if i have dates as a dimension?


      Thanks for your help!



        • Re: Limit date values on continuous x-axis
          Stefan Wühl



          I don't think a chart with a continuous axis is most appropriate here. Try instead to limit your expression results to the months you want to show.

          You can use a calculated dimension for that, or by applying a set expression to each aggregation function in your expressions, the set expression should look like:




          {<TWELVE_MONTH_ROLLING.NumDate = {">=$(=num(addmonths(max(TWELVE_MONTH_ROLLING.NumDate),-2)))"} >}

          [TWELVE_MONTH_ROLLING.Net Sales (consolidated)] )


          See also attached,


            • Re: Limit date values on continuous x-axis

              Hi Stefan,


              thanks for the quick response!


              The code you suggested actually does the trick in my example document.

              But unfortunately in the real document it doesn't. I suspect that is because there I use the function "accumulate 12 steps back" to build a 12 months rolling diagram.


              The problem is that I only want 6 Months in the chart but I need 6 months back plus another 12 months back for the correct calculation of the expression's value.


              Any ideas?