Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis and Today()

Dear all,

I have a question on set analysis icw ‘Today()’. I would like to have a table with the following data:

Relation

Article

Week-2

Week-1

Current week

A

1

#

#

#

B

2

#

#

#

C

2

#

#

#

I was thinking to create this with a set analysis but I cannot seem to get it working. Who knows how to?

Thanks!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

sum({<Date={'>=$(=date(weekstart(today()-7)))<=$(=date(weekend(today()-7)))'}>}Amount)


talk is cheap, supply exceeds demand

View solution in original post

9 Replies
tresesco
MVP
MVP

Could you post a sample?

Not applicable
Author

Here you yo. Now I have the data for the 26th and the 28th 'fixed' but I want to have it as Today and Today-1 (or Week and week-1)

Gysbert_Wassenaar

Try:

sum({<Date={'$(=date(today()))'}>}Amount)

sum({<Date={'$(=date(today()-1))'}>}Amount)

sum({<Date={'>=$(=date(today()-6))<=$(=date(today()))'}>}Amount)

sum({<Date={'>=$(=date(today()-13))<=$(=date(today()-7))'}>}Amount)


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks! It works perfectly for the today() and Today-1, but for the week I need the 'rounded' weeks so monday-sunday. Do you have a solution for that too?

tresesco
MVP
MVP

May be like attached sample?

Gysbert_Wassenaar

The weekstart and weekend functions should do the trick:

sum({<Date={'>=$(=date(weekstart(today())))<=$(=date(weekend(today())))'}>}Amount)


talk is cheap, supply exceeds demand
Not applicable
Author

Almost there. It works for the current week ( G Wassenaar) but not for the week-1. I get the whole datset as response, not only the week-1.

Any ideas?

Gysbert_Wassenaar

sum({<Date={'>=$(=date(weekstart(today()-7)))<=$(=date(weekend(today()-7)))'}>}Amount)


talk is cheap, supply exceeds demand
Not applicable
Author

Perfect!