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

if Statement Expression

hi having trouble with the following logic.

My first expression works great however i would like to add the following logic to the statement.

I have a field for company code and depending on the company code i would like the expression to work,

so for example

if(Bol_ID = '000' or Bol_ID = '001' then do the following (code below)  else show 0.

sum(

Aggr(

DISTINCT

Max(Artikel.Lagersaldo) * Max([Artikel.Vägt inpris])

,

Artikel.ArtikelNr

)

)

Help is much appreciated.

best,

Brad

1 Solution

Accepted Solutions
Not applicable
Author

This may work:

sum(if(Bol_ID = '000' or Bol_ID = '001', Aggr(DISTINCT Max(Artikel.Lagersaldo) * Max([Artikel.Vägt inpris]),Artikel.ArtikelNr )))

Hope that helps.

Matt

View solution in original post

1 Reply
Not applicable
Author

This may work:

sum(if(Bol_ID = '000' or Bol_ID = '001', Aggr(DISTINCT Max(Artikel.Lagersaldo) * Max([Artikel.Vägt inpris]),Artikel.ArtikelNr )))

Hope that helps.

Matt