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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis and if inside value

Hi,

I have a little problem. I would like to have if-statement to decide my value within the set analysis.

Here is what I have tried:

varMaxDate is a variable, that holds the max date.

And I don't actually use YYYY or WW fields, I just needed to change them for security reasons.

=sum({<WW={'(if(isNull(GetFieldSelections(WW)),week(varMaxDate),WW))'}, YYYY={'(if(isNull(GetFieldSelections(YYYY)),year(varMaxDate),YYYY)'} >}#1)

Cheers,

Niko

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Sum({<WW={'$(=If(IsNull(GetFieldSelections(WW)), Week(varMaxDate), WW))'}, YYYY={'$(=If(IsNull(GetFieldSelections(YYYY)), Year(varMaxDate), YYYY))'}>} #1)

View solution in original post

2 Replies
sunny_talwar

Try this:

=Sum({<WW={'$(=If(IsNull(GetFieldSelections(WW)), Week(varMaxDate), WW))'}, YYYY={'$(=If(IsNull(GetFieldSelections(YYYY)), Year(varMaxDate), YYYY))'}>} #1)

Not applicable
Author

Well that worked well, thank you!