Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement and set analysis togather

Can we use If statement and Set analysis togather???

16 Replies
Not applicable
Author

Hi,

But your Example is purly based on if(...) condition and not on the basis of nested if condition as well as set analysis.... can you send me any examples based on set analysis and multiple if conditions  ?

yojas

SunilChauhan
Champion
Champion

its nested if

Sunil Chauhan
Not applicable
Author

yes it is nested if but without set analysis...... i want it with set analysis.....

Not applicable
Author

Hi,

Sunil has a valid point.

Set analysis and Nested If can be used together.

Please find the attchaed app and see in chart how both are used together.

..

Ashutosh

SunilChauhan
Champion
Champion

see the below code

sum({<Year={'2012'}>} if(product='a',if(category=1,sale)))

nested if with set analysis.

hope this helps

Sunil Chauhan
Not applicable
Author

What about a nested sum?

This does not work for me.

=Sum({<BandwidthandCircuit={'BandwidthandCircuit'}>}IF(sum(InBandwidth)+sum(OutBandwidth)=0,0,

IF(sum(InBandwidth)=0,sum(OutBandwidth/OutBandwidth) * 100,

IF(sum(OutBandwidth),(sum(In_Averagebps)/sum(InBandwidth)) * 100,

sum(Out_Averagebps/OutBandwidth)+sum(In_Averagebps/InBandwidth)*50))))

Not applicable
Author

Hi Alex Peasley,

Basic aggregation functions can not be nested.

But, if You want to then you have to use advanced aggregation function. So, using aggr() will help you out.

To see how to use aggr(), search in community or in Qlikview manual/help also you will find details.

..

Ashutosh