9 Replies Latest reply: Jun 8, 2010 1:50 PM by John Witherspoon RSS

    How to Calculate sum of Sales of a Previous week

    EvgenyGin_J

      Good Day.

      I'm trying to calculate sum of Amount.

      [View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/674/3806.SalesAmount.docx:550:0]

      i have two straight tables (ST1 and ST2)

      in ST1 i want to show calculated value of Amount of current week that i click(for ex 2008/31). I calculate it by a formula: sum(Amount). And we see that dimension (week(opDate)) is also 31. ok.

      But in ST2 i want to calculate Amount for the previous week.

      Formula is: sum({$<Week={"(=Week(opDate-7))"}>}Amount)

      But as the result i have got the same values in ST2 and ST1. But dimensions a ddifferent(31 and 30).

      How to calculate in one table current(clicked) week amount,

      and second table previous week amount.

      And why in my example they are equals?