Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I have to calculate sum of sales, condition is I have to sum sales for last week only.I have date field called Date_D that has all the dates. I want to make my set expression dynamic ..How Can I do with Variables and with out variables.

Hi ,

I have to calculate sum of sales, condition is I have to sum sales for last week only.I have  date field called Date_D that has all the dates. I want to make my set expression dynamic ..How Can I do with Variables and with out variables.

one more query,

In this query, I need to calculate sum sales for yesterday date , but I can not use Today()-1 as on Moday, it will fetch Sundy Data and I dont have any data for sunday,

I tried this logic

date(if(WeekDay(today())='Mon',(today()-3),(today()-1))

but how to use in Set Expression or by using variables?

Thanks in Advance !!

Sid

3 Replies
Frank_Hartmann
Master II
Master II

can you share a sample?

Anonymous
Not applicable
Author

Hi



=Sum({<Date_D = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}>} sales)……………………………….FOR SELECTING last 7 days sales






sunny_talwar

Or may be this:

=Sum({<Date_D = {"$(='>=' & Date(Max(Date_D) - 6, 'DateFieldFormatHere') & '<=' & Date(Max(Date_D),'MM/DD/YYYY'))"}>} sales)

This will show past one week based on your selection in Date_D field.

Best,

Sunny