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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis Equivalent

Hi all

I just want to ask what is the equivalent of this expression in set analysis:

Sum(if(DestServiceProvider=Carrier and Type ='OB',Duration,0))

where Carrier is another field

attached is a sample qvw

Thank You

6 Replies
Anonymous
Not applicable
Author

Hi,

Try this:

=Sum({<DestServiceProvider=Carrier, Type={'OB'}>}Duration)

Not applicable
Author

thank you for your reply but the answer that you gave requires a selection before it show the correct data.

Anonymous
Not applicable
Author

Try this :

=Sum({<Type={'OB'}>}if(DestServiceProvider = Carrier,Duration,0))

Not applicable
Author

I just want to know if this expression will not affect the performance of my dashboard because it still has an if statement.. with 50M worth of records??

thanks

Anonymous
Not applicable
Author

Sorry I am not sure about the performance

johnw
Champion III
Champion III

So far as I know, without doing something rather complicated (link below), the second expression Leni provided is as good as it's going to get given your data model.  The problem is that set analysis is not sensitive to your dimension values.  On each row, there's a specific Carrier, and you want your set to ONLY include that carrier for that row.  Instead, the set will include all selected Carriers, and thus isn't doing the match you want.

The right way to solve this problem is probably with data model changes to link your data more explicitly.

If there's a good reason not to do that, and performance with the sum({...} if(...)) isn't acceptable, have a look at this:

http://community.qlik.com/docs/DOC-1335