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

Dear Jagan,

               Right now im testing on text object. if you dont mind can u send an eg. or can u solve my above sample and show it to me please.

Regards,

Antony.

Anonymous
Not applicable
Author

Anton,

Your total wont match with below condition, you have to it in backend script to get it done.

Sum(If(Id=5, Value))*Sum(If(Id=10, Value)) as Value

Or if you are using straight table, in the expression total mode, use Sum of Rows instead of Expression Total.

Thx

Satya

Not applicable
Author

Hi U can get the ur output through multi view suggestion.

Please break a one table to Two table.

And See the attachment.

Regards.

Kabilan K.

flipside
Partner - Specialist II
Partner - Specialist II

Hi Antony,

If you really have to use the Products table as it is, then the expression you will need will be ...

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

... however I would split the table as per MultiView's suggestion as it is much easier to visualise and work with, or create a single table with the structure ...

ProductCode, QtyId, QtyValue, RateId, RateValue

flipside

Not applicable
Author

Hi Flip,

Thanks for your rpely.

                                 Please can you send me an example application.

Regards,

Antony.

Not applicable
Author

Hi Flip,

Thanks a lot,

                 You expression is working on my example application.

How do i write the same expression for my below table.

Gradj:

LOAD com,

     unit,

     gra_fyr,

     num,

     Date,

     MONTH,

     YEAR,

     gra_srl,

    gra_id, (Id)

     gra_po_amt,

     rate,  (Value)

     gra_rmk

FROM

D:\Latest_QVD_Generator\gradj.qvd

(qvd);

Regards,

Antony.

Not applicable
Author

Product code?

Not applicable
Author

Hi Kabilan,

     That was my example. the above one which is mentioned now is my actual table.

Thanks.

jagannalla
Partner - Specialist III
Partner - Specialist III

Gradj:

LOAD com,

     unit,

     gra_fyr,

     num,

     Date,

     MONTH,

     YEAR,

     gra_srl,

    gra_id as Id

     gra_po_amt,

     rate as Value

     gra_rmk

FROM

D:\Latest_QVD_Generator\gradj.qvd

(qvd);

- Use same expression given by flipside

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

But where is the ProductCode column? I mean which column we need to consider from actual table as Product Code.

Not applicable
Author

Hi Jagan,

               That was my Example.. dont consider that one....