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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need a help in if condition query....

Dear All,

             I have a issue on below conditon .......

= sum (if(id=5,value) * if(id=10,value))

id = 5 is Qty

id = 10 is Rate

The above condition is showing zero....

Can any one help me...

Regards,

Antony.

39 Replies
Not applicable
Author

Here i need the output Date,year,month,com,unit and num wise....

Not applicable
Author

Yes, I know that this is a sample.

U must know what is Aggr function and Purpose? (Through Help menu)

Then U can Write a expression..

flipside
Partner - Specialist II
Partner - Specialist II

One issue you need to be sure on is that there is only one (Rate) Id per Product Code in your table, or the rates will be added together which is likely to be incorrect. Maybe the expression should be more like ...

=sum(aggr(sum({<Id={5}>} Value) * max({<Id={10}>} Value), [Product code]))

... so only the largest rate is used where duplicates exist.  More likely you might want to multiply the qty with the rate applicable at the time, and you then need to factor in date comparisons. At this stage I'd be asking myself why make things very complicated, when there's an easier route, BUT if you are absoultely sure you want to proceed with the expression, then just substitute Id with gra_id, Value with rate and [Product code] with whatever your Product Code is in the qvd.

flipside

Not applicable
Author

Can u send a QVD?

Not applicable
Author

Thanks flip....

Regards,

Antony.

Not applicable
Author

Hi Kabilan,

               Sorry, i can't share.

sivarajs
Specialist II
Specialist II

PFA

Not applicable
Author

Thanks Sivaraj.....

Anonymous
Not applicable
Author

Antony, if your question is answered, kindly mark it as answered.

Regards

MultiView

Not applicable
Author

Hi Sivaraj,

I tried like ur sample, but I forgot to use Group By, so that i got a null in Sales.

Thank u to Remind this....

@ All    :   Group By(In script)=Aggr(In Expression) Ryt?

If I am wrong Pls Correct me.

Regards,

Kabilan K.