Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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

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!