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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis query

Can anyone help me to put this set analysis in this expression please. I can't get it to work!

sum(aggr(num([Days Spent Offline]),[Hotel Name],[Room Number],[Offline Date]))

{<[Reporting Week]=, [Reporting Date]={'>=$(=date(vPreviousMonthStart))<=$(=date(vPreviousMonthEnd))'},[Reason Group] = {'Upgrade'}>}

thanks

9 Replies
Not applicable
Author

try this

sum({<[Reporting Week]=, [Reporting Date]={'>=$(=date(vPreviousMonthStart))<=$(=date(vPreviousMonthEnd))'},[Reason Group] = {'Upgrade'}>}[Days Spent Offline])

Not applicable
Author

Hi, the aggr is missing from that though so that won't work. i need to combine them both.

Do you have any more ideas?

Not applicable
Author

Or if i cant combine the set anaysis with the expression, could someone help me transform it to an if statement?

Thanks

Not applicable
Author

does anyone have any ideas?

pennetzdorfer
Creator III
Creator III

There's an excellent Set Analysis Wizard (thanks to Stefan Walther):

http://tools.qlikblog.at/SetAnalysisWizard/

Hope that helps!

Regards,

Florian

Not applicable
Author

Hi, thanks for the reply,

I cant find any option to use AGGR in that wizard unfortunately

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

sum({<[Reporting Week]=, [Reporting Date]={'>=$(=date(vPreviousMonthStart))<=$(=date(vPreviousMonthEnd))'},[Reason Group] = {'Upgrade'}>}
aggr(num([Days Spent Offline]),[Hotel Name],[Room Number],[Offline Date]))

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi, thanks for the reply but it didnt work

Not applicable
Author

TRY THIS

if([Reporting Date] >= $(vPreviousMonthStart) or [Reporting Date] <= $(vPreviousMonthEnd),

Aggr(sum(num([Days Spent Offline])),[Hotel Name],[Room Number],[Offline Date]))