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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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))