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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis for date

Hi,

I am trying to make a table with data for the past 5 days. This is the expression I am using:

Sum( {$< EventDate = {'$(vMaxDate)'},Account= -{'500','400'} >} Revenues).

What is the correct way to write this expression so that I have vMaxDate-1, vMaxDate-2......vMaxDate-5 in the set analysis? I have tried having the "-number" in different places in the equation but I keep on getting 0. Help appreciated.

Cheers.

22 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Try kind of this

Sum( {$< EventDate = {'>$(=Date(vMaxDate-5))<=$(=vMaxDate)'},Account= -{'500','400'} >} Revenues)

MK_QSL
MVP
MVP

=SUM({<EventDate = {">=$(=Date($(vMaxDate)-4,'DD/MM/YYYY'))<=$(vMaxDate)"},Account= -{'500','400'}>}Revenues)

Not applicable
Author

didn't work, still getting no values

Not applicable
Author

didn't work, still getting no values

Not applicable
Author

didn't work, still getting no values

MK_QSL
MVP
MVP

What is the definition of your vMaxDate?

Not applicable
Author

= If(WeekDay(Max(EventDate)) = 'Sat', Date(Max(EventDate)-1),

  If(WeekDay(Max(EventDate)) = 'Sun', Date(Max(EventDate)-2),

  Date(Max(EventDate))))

We have no data on saturday and sundy. the date is in this format: 25.07.2014

MK_QSL
MVP
MVP

Try this....


=SUM({<EventDate = {">=$(=Date($(vMaxDate)-4,'DD.MM.YYYY'))<=$(vMaxDate)"},Account= -{'500','400'}>}Revenues)

aveeeeeee7en
Specialist III
Specialist III

Try something like this:

Sum({<EventDate={'$(=(vMaxDate))'},Account={'*'}-{'500','400'}>}Revenues)

Regards

Aviral Nag