Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
engishfaque
Specialist III
Specialist III

Sum of quantity where cdate >= d7

Dear All,

I would like to calculate sum of quantity where cdate >= d7.

I'm going to achieve my required result through following script and expression in Qlik Sense, but given below expression is returning Zero "0" value.

Please make correction, and share me expression.

My script:

temp:

Load

     date(Max([date/time])-6) as d7

Resident sales2015 Group By [date/time];

My expression:

sum({<cdate = {'>=[d7]'}>} quantity)

Kind regards,

Ishfaque Ahmed

10 Replies
engishfaque
Specialist III
Specialist III
Author

Dear All,

Problem has been resolved, here are the expressions.

1D = Sum({$<[cdate] = {">=$(=Date(Max([date/time]),'DD-MM-YY'))"}>} [quantity])

7D = Sum({$<[cdate] = {">=$(=Date(Max([date/time])-6,'DD-MM-YY'))"}>} [quantity])

15D = Sum({$<[cdate] = {">=$(=Date(Max([date/time])-15,'DD-MM-YY'))"}>} [quantity])

30D = Sum({$<[cdate] = {">=$(=Date(Max([date/time])-30,'DD-MM-YY'))"}>} [quantity])

Another thread is here,

Sum of Quantitiy - Expression

Kind regards,

Ishfaque Ahmed