4 Replies Latest reply: Nov 23, 2016 11:02 PM by Richard Judkins RSS

    Show YTD regardless of month selected - QlikSense Server

    Richard Judkins



      So I have a table showing MTD sales, and YTD Sales.


      I have a filter pane where I can select the month and/or the year.


      The MTD expression is RangeSum(Sum({<Year=, Month=, Quarter=, Week=, DateField=, TRANS_DATE={">=$(=Num(MonthStart(Max(TRANS_DATE))))<=$(=Max(TRANS_DATE))"}>} QTY))


      THE YTD expression is Sum({<Year=,  Month =, Quarter=, Week=, DateField=, TRANS_DATE={">=$(=Num(YearStart(Max(TRANS_DATE))))<=$(=Max(TRANS_DATE))"}>} QTY)


      The issue I have is this: with a month selected, the MTD and YTD figures are exactly the same (they are the correct MTD figures).


      With nothing, or just a year, selected, there is no longer a MTD (which is probably logical) but the YTD is correct.


      I simply cannot work out how to get it to show the correct MTD (as of the month selected) and YTD on the same table.


      I don't necessarily mind if the YTD doesn't reflect the "as of" the month selected - it can be YTD as of latest data regardless of month selected if need be. It would be nice if it did, but not a show-stopper.


      Any help greatly appreciated, thanks.