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: 
Not applicable

Set Analysis

hi,

I want to convert the following expressions into set analysis

1. Sum (if(Supplier_ID = 3, Cost*1.12,if(Supplier_ID = 991, Cost*1.15,Cost)))

2. Sum(Cost)/Sum(if(ActionType_ID = 4 AND Source_ID =1,1,0))

3. Sum(if(ActionType_ID = 5 AND (Source_ID = 1 OR (Source_ID = 3 AND Moked_Mail=0 AND (OrigRegsTime >= v_MinDate or            OrigRegsTime = '0000-00-00'))) or (ActionType_ID = 7) or (ActionType_ID = 8), 1,0))

4. Sum(if(ActionType_ID = 5 or ActionType_ID = 8 or ActionType_ID = 13 ,1,if(ActionType_ID = 6 or ActionType_ID = 7,-1,0)))

Thanks in advance,

1 Reply
Not applicable
Author

Hi Shani,

First can be done for example like that:

sum({<Supplier_ID={'3'}>} Cost * 1.12)+sum({<Supplier_ID={'991'}>} Cost * 1.15)+sum({<Supplier_ID-={'3','991'}>} Cost)


You need to remember that it will not sum the cost for rows which have null for Supplier_ID field (if such rows exist in you data of course).

You can do the rest with similar approach.

BR,

Milosz