0 Replies Latest reply: Nov 6, 2016 10:19 PM by Nino Gavino RSS

    Current Date Selection against Previous Selection last Month

    Nino Gavino

      Hi,

       

      I have the following script

       

      LOAD Date,

        Day(Date) as Day,

        Month(Date) as Month,

           Name,

           Sales,

           Currency

      FROM

      [C:\Users\Desktop\QLIKVIEW SAMPLE.xlsx]

      (ooxml, embedded labels);

       

       

       

       

      LOAD Date,

           [Currency Rate],

           Currency

      FROM

      [C:\Users\Desktop\QLIKVIEW SAMPLE.xlsx]

      (ooxml, embedded labels, table is [Currency Rate]);

       

       


      I want to see November 1 to 3 2016 against October 1 to 3 2016 Sales. Or Whenever i select the date lets say November 1 to 7 2016 it would show October 1 to 7 2016. Its like a month to date vs last month to date but with the selection of the dates.


      My expression are


      Current Selection

      Sum({$<MonthID = {$(=Max(MonthID))}, Year = , Quarter = , Month = >} Sales)


      Previous Selection

      Sum({$<MonthID = {$(=Max(MonthID) – 1)}, Year = , Quarter = , Month = >} Sales)


      can you help me here? thanks