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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Same Day Last Week comparison

I have a data set that looks like :

Date                 Sales  ....    ....   .....

1/20/2014          100

1/19/2014          200

1/18/2014          300

1/17/2014           400

1/16/2014          500

1/15/2014          600

1/14/2014          700

1/13/2014          800  

1/12/2014          900

Trying to create a "Same Day Last Week Expression"

Date                 Sales        Last Week

1/20/2014          100               800

1/19/2014          200               900

1/18/2014          300

1/17/2014           400

1/16/2014          500

1/15/2014          600

1/14/2014          700

1/13/2014          800  

1/12/2014          900

I can not get the Set analysis to work.(sum({$<date = {$(lw_date)}>} sales )

I appreciate any help.

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Hey Amir,

Please check out the attached file. I did everything on the backend.

Hope it helps

Thanks

AJ

View solution in original post

5 Replies
Not applicable
Author

Hey Amir,

Please check out the attached file. I did everything on the backend.

Hope it helps

Thanks

AJ

Not applicable
Author

Thank you so much Ajay, this is very clever. I really appreciate your help.

iktrayanov
Creator III
Creator III

Another option is

=Below(Sum(ActualSales),7)

Not applicable
Author

You could also try something like:

sum ({$< date = {'$(=date(today(0)-7))'}>}  sales)

You could also set a date variable and call it in the set analysis, for instance:

let vSameDayLastWeek = date(today()-7);

Then the set would be:


sum({$< date = {'$(vSameDayLastWeek)'} >}sales )


Best,

Matt

Not applicable
Author

This also worked. PERFECT

Thanks