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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

set analysis issue

Hi All,

As per requirement if FRQ_Type is A then i need to show Q4 data for FRQ_TYPE A,otherwise need to put Q4 data for FRQ type Q

For one particular year

But after appyling if else condition in set analysis below expression is not working

if(FRQ_TYPE='A',Avg({<INDICATOR_NAME={'% of Non-Bank Private Debt to Nominal GDP'},COUNTRY={'Singapore'},FRQ_TYPE={'A'},QUARTER={'Q4'}>}INDICATOR_VALUE),

Avg({<INDICATOR_NAME={'% of Non-Bank Private Debt to Nominal GDP'},COUNTRY={'Singapore'},FRQ_TYPE={'Q'},QUARTER={'Q4'}>}INDICATOR_VALUE))

plz suggest on this.

Thanks

9 Replies
sushil353
Master II
Master II

Hi,

What issue are u getting.. if possible share sample app.

deepakqlikview_123
Specialist
Specialist
Author

Please find attached sample application for this

Kushal_Chawda

What if FRQ_TYPE is other than A or Q?

rubenmarin

Hi Deepak, the first "if" will return several values for each year, so it will return null and the "if" will go (almost) always for the "else", try with this expression:

if(MinString(FRQ_TYPE)='A',Avg({<INDICATOR_NAME={'% of Non-Bank Private Debt to Nominal GDP'},COUNTRY={'Singapore'},FRQ_TYPE={'A'},QUARTER={'Q4'}>}INDICATOR_VALUE),

Avg({<INDICATOR_NAME={'% of Non-Bank Private Debt to Nominal GDP'},COUNTRY={'Singapore'},FRQ_TYPE={'Q'},QUARTER={'Q4'}>}INDICATOR_VALUE))

Peter_Cammaert
Partner - Champion III
Partner - Champion III

There are 5 years (2005-2009) that have both A and Q values for FRQ_TYPE. What do you want to do for those? Select FRQ_TYPE=A like Ruben suggests? In that case I think you better store FRQ_TYPE in your calendar so that it becomes a real dimension value tied to a particular year. As a result, your original expression will suddenly start to work.

And you can omit the IF clause and FRQ_TYPE={'A'} or {'Q'} modifier from your set spec. Makes things a lot simpler.

Peter.

deepakqlikview_123
Specialist
Specialist
Author

hi peter

if FRQ type A is present then i need to put value for A otherwise need to show value for FRQ_TYPE Q for Q4

Can you please suggest how shall i go ahead in back end.

Thanks

deepakqlikview_123
Specialist
Specialist
Author

Thanks Marin,

It is working fine initially.But after selecting FRQ type Q it represnets all values for FRQ type Q which is not required if FRQ type A present,if FRQ type A is not present then only i need to show value for FRQ type Q

thanks

rubenmarin

Maybe ignoring selections when checking FRQ:

if(MinString({1} FRQ_TYPE)='A',Avg({<INDICATOR_NAME={'% of Non-Bank Private Debt to Nominal GDP'},COUNTRY={'Singapore'},FRQ_TYPE={'A'},QUARTER={'Q4'}>}INDICATOR_VALUE),

Avg({<INDICATOR_NAME={'% of Non-Bank Private Debt to Nominal GDP'},COUNTRY={'Singapore'},FRQ_TYPE={'Q'},QUARTER={'Q4'}>}INDICATOR_VALUE))

deepakqlikview_123
Specialist
Specialist
Author

hi,

Still it is not working for else part when all data is present.

thamks