Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calcluation ontop of expression

Hi.

i have the following issue;

i have three companies 000,001,003.

i run a expression to bring forth a value; I purposely ignore 003 as i want it to be 0 (it carrys into qlikview a strange value that needs to be surpressed.

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

everything works fine until i wish to select all three companies to do a consolidation. when i do this i get '0'.

is there any way i can adjust the code above in the front-end to sum up 000 and 001 and ignore 003 when selecting all 3 companies?

Best,

Bradley

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Maybe this?

sum({<Bol_ID-={'003'}>} aggr(distinct max({<Bol_ID-={'003'}>} Artikel.Lagersaldo) * max({<Bol_ID-={'003'}>} [Artikel.Vägt inpris]),Artikel.ArtikelNr)))

View solution in original post

2 Replies
johnw
Champion III
Champion III

Maybe this?

sum({<Bol_ID-={'003'}>} aggr(distinct max({<Bol_ID-={'003'}>} Artikel.Lagersaldo) * max({<Bol_ID-={'003'}>} [Artikel.Vägt inpris]),Artikel.ArtikelNr)))

Not applicable
Author

Hi John Thanks for the help.

it worked great.

i wish to achieve one more step with this Expression i would like to take the result and * by a new field BAS_CROSS_INV. However my syntax is not great.

sum({<Bol_ID-={'003'}>} aggr(distinct max({<Bol_ID-={'003'}>} Artikel.Lagersaldo) * max({<Bol_ID-={'003'}>} [Artikel.Vägt inpris])*[BAS_CROSS_INV]),Artikel.ArtikelNr)))

Could you lend a helping hand if possible?

Best,

Brad