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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
kamal_sanguri
Specialist
Specialist

How to use function in Set Analysis

I want to replace {'201504'} with max(PERIOD), Any Idea on this

=if(GetSelectedCount(PERIOD)=0,sum({<PERIOD={'201504'}>}BUD_DOLLARS_CY),sum(BUD_DOLLARS_CY))

Labels (1)
1 Solution

Accepted Solutions
maximiliano_vel
Partner - Creator III
Partner - Creator III

Try

=if(GetSelectedCount(PERIOD)=0,sum({<PERIOD={$(=Max(PERIOD))}>}BUD_DOLLARS_CY),sum(BUD_DOLLARS_CY))

View solution in original post

7 Replies
MK_QSL
MVP
MVP

=if(GetSelectedCount(PERIOD)=0,

     sum({<PERIOD={'$(=Max(PERIOD))'}>}BUD_DOLLARS_CY),

     sum(BUD_DOLLARS_CY))


or

=if(GetSelectedCount(PERIOD)=0,

     sum({<PERIOD={'$(=Date(MonthStart(AddMonths(Date#(Today()),-4)),'YYYYMM'))'}>}BUD_DOLLARS_CY),

     sum(BUD_DOLLARS_CY))

maximiliano_vel
Partner - Creator III
Partner - Creator III

Try

=if(GetSelectedCount(PERIOD)=0,sum({<PERIOD={$(=Max(PERIOD))}>}BUD_DOLLARS_CY),sum(BUD_DOLLARS_CY))

Not applicable

=if(GetSelectedCount(PERIOD)=0,sum({<PERIOD={"$(=max(PERIOD))"}>}BUD_DOLLARS_CY),sum(BUD_DOLLARS_CY))

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

To use any function inside Set Analysis you need = sign before the function

kamal_sanguri
Specialist
Specialist
Author

Thank you very much for your expertise, I have one more question.. Different people gave me different functions.. and all of them worked.. for ex: if I put the max funciont inside " " or ' ' or even if I just write function without any one of them all worked.. so what is the difference and which is a better/correct way.

Thanks again,

-Kamal

kamal_sanguri
Specialist
Specialist
Author

Thanks

kamal_sanguri
Specialist
Specialist
Author

Thanks