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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
julian
Contributor II
Contributor II

IF AND OR statement in set analysis

Hi there

If have this calculation 

(SUM( AGGR(AVG(EAV), ArticleKey)) / 7.45)

I need to add the following. If [MediaName ]= 'Magazine' AND MediaCountry = 'Denmark' /7 *[ArticleSize] OR [MediaName] = '**bleep**blade & Magasiner' AND [MediaCountry] = Sweden OR Norway /2 *[ArticleSize]

Thanks

10 Replies
julian
Contributor II
Contributor II
Author

I finally managed to figure it out! The problem with the previous one was that instead of having EAV as Else I just needed to replace it with a 1 because it was preceded with / it divides it with the Else statement so replacing it with the 1 means you get the original EAV calculation. Thank you so much for your help Lauri I couldn't have solved it without it. Here is the correct calculation:

(SUM( AGGR(AVG(EAV), ArticleKey))/7.45) /

If([MediaTypeName]= '**bleep**blade og magasiner'AND [MediaCountryName] = 'Danmark' ,7*([Størrelse]),

If([MediaTypeName] = '**bleep**blade og magasiner' AND Match([MediaCountryName], 'Sverige', 'Norge'), 2*([Størrelse]), 1))