5 Replies Latest reply: Apr 25, 2012 5:39 AM by Stefan Olausson RSS

    Get previous dates sum

      Hello fellow QlikViewers!
      I am trying to get the sum for the previous date in a chart, but it's not working. You can see the result in the attachement.
      In the example one can see a date field together with the number of orders that specific date. Then I want to output the number of orders the day before. As you can see, that column does not work... It should look like the one after, called "Goal". That one is using the above() function, but since I will use this value in an aggregated expression later on, that solution doesn't work. The expression behind my failed column looks like this:
      sum({<[Order Date] = {"$(=date(max([Order Date])-1))"}>} [Order Count])
      Can someone please help me?
      Thank you,
      Stefan
      Order   DateNo of OrdersPrev Date No of   OrdersGoal
      2012-01-0130-
      2012-01-0260003
      2012-01-031 1730600
      2012-01-0499901 173
      2012-01-058600999
      2012-01-063100860
      2012-01-071450310
      2012-01-098280145
      2012-01-081140828
      2012-01-108870114
      2012-01-111 4840887
      2012-01-1260501 484
      2012-01-131 6900605
      2012-01-1453301 690
      2012-01-162 2710533
      2012-01-1526202 271
      2012-01-171 4690262
      2012-01-182 08001 469
      2012-01-191 23302 080
      2012-01-2091501 233
      2012-01-215970915
      2012-01-231 6970597
      2012-01-2227401 697
      2012-01-241 1930274
      2012-01-252 93201 193
      2012-01-261 00902 932
      2012-01-2792901 009
      2012-01-286400929
      2012-01-292640640
      2012-01-30955955264
      2012-01-311 1380955