2 Replies Latest reply: Jul 26, 2016 4:23 AM by needy qliker RSS

    Re: SQL Sub Query Equivalent in Qlik Sense

    needy qliker

      Table:

      Date,Sales

      08-06-2016,9

      12-06-2016,3

      20-07-2016,9

      14-07-2016,1

      19-08-2016,10

      22-08-2016,2

      25-12-2016,0

       

      OutPut:

      Date,Sales,Selective_Sum

      18-06-2016,9,0

      12-06-2016,3,9

      20-07-2016,9,12

      14-07-2016,1,21

      19-08-2016,10,23

      22-08-2016,2,20

      25-12-2016,0,0

       

      Logic: Selective_Sum = Sum of Sales in Last Two Months from the current date for each row.

      If I were to do this is SQL ,that would be a piece of cake using a subquery.

      Note: You are free to order things up.

      Note: There are gaps between the dates.

      Please avoid loops,Above, Aggr if possible.

      Thanks alot in advance.