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

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

if statement - set analysis

hi i am trying to achieve the following

I have three companies

000 - Sweden

001 - Norway

003 - UK

when calculating KPI incoming orders i have the following statement

Sum(if(Bol_ID = 003,OrderRad.NettoBelopp*#Dat_O*OH.Kurs_FSG_act/2,OrderRad.NettoBelopp*#Dat_O))

This is correct, when running for individual companies, but when i try to put together 000 and 003 i get the wrong values,

is it possible to rewrite the statement whereby you always include 003 condition instead of having an if statement?

Best,

Bradley

2 Replies
er_mohit
Master II
Master II

Sum(if(wildmatch(Bol_ID,'001','003'),OrderRad.NettoBelopp*#Dat_O*OH.Kurs_FSG_act/2,OrderRad.NettoBelopp*#Dat_O))

Sokkorn
Master
Master

Hi Bradley,

Not sure you try this yet:

1. In set analysis

Sum({$<Bol_ID = {'000','003'}>} OrderRad.NettoBelopp*#Dat_O*OH.Kurs_FSG_act/2)

2. Use IF()

Sum(

    If(Match(Bol_ID,'000','003'),OrderRad.NettoBelopp*#Dat_O*OH.Kurs_FSG_act/2,

        OrderRad.NettoBelopp*#Dat_O

    )

)

Regards,

Sokkorn