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

How to fix this IF condition?

Hello,

Please, how to fix the expression below?

if (UF = 'EX' and ProductMaterial = min(Color_id), sum (costmat))

ProductMaterial  = min (Color_id)  is not working.

I need to pick up just the first color number from each material and from each product.

Product

Color_id

ProductMaterial

Cost

UF

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

try this

if (UF = 'EX' and Color_id = Aggr(min(Color_id),ProductMaterial), sum (costmat))

or try this

try this

if (UF = 'EX' and Color_id = min(Color_id), sum (costmat))

View solution in original post

4 Replies
er_mohit
Master II
Master II

try this

for min color id

  aggr( min (Color_id),ProductMaterial)

or try this way

ONLY({<Color_id  = {"=min (Color_id)"}>}ProductMaterial)

sum({<UF={'EX'},Color_id={"=MIN(Color_id)"}>}costmat)



Not applicable
Author

try this

if (UF = 'EX' and Color_id = Aggr(min(Color_id),ProductMaterial), sum (costmat))

or try this

try this

if (UF = 'EX' and Color_id = min(Color_id), sum (costmat))

Not applicable
Author

in script--

load

min(Color_id) as min

from table group by ProductMaterial;

the try your syntax

Not applicable
Author

Thanks very much for everyone!... the expression below fits well:

if (UF = 'EX' and Color_id = Aggr(min(Color_id),ProductMaterial), sum (costmat))