6 Replies Latest reply: Jul 25, 2016 5:48 AM by needy qliker RSS

    SQL SubQuery Equivalent in QlikScript?

    needy qliker

      Table:

      Date,Sales

      12-07-2016,3

      13-07-2016,9

      14-07-2016,1

      19-07-2016,10

      22-07-2016,2

      25-07-2016,0

       

      OutPut:

      Date,Sales,Selective_Sum

      12-07-2016,3,0

      13-07-2016,9,3

      14-07-2016,1,12

      19-07-2016,10,0

      22-07-2016,2,10

      25-07-2016,0,2

       

      Logic: Selective_Sum = Sum of Sales in Last Three Days 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. Sum of Last three rows is not the solution I am looking for.

      Please avoid loops if possible.

      Thanks alot in advance.