Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Straight Table: sum(amount) when condition is fulfilled...

Hello,

I'm making a straight table with a sum of purchases shown for each month. This first column is for cloths, the next for household goods etc...

making the sum is not difficult: Sum(amount) but when I add an 'if' so I only include items that are cloths (for example Goods='cloths') the result is always zero.

Whats wrong with this statement as expression:

=if(Goods='Cloths',sum(Amount),0)

What should be changed?

1 Solution

Accepted Solutions
vijay_iitkgp
Valued Contributor

Straight Table: sum(amount) when condition is fulfilled...

Hi,

Use Sum(If(Goods='Cloths',Amount))

3 Replies
vijay_iitkgp
Valued Contributor

Straight Table: sum(amount) when condition is fulfilled...

Hi,

Use Sum(If(Goods='Cloths',Amount))

Not applicable

Straight Table: sum(amount) when condition is fulfilled...

Thanks a lot!

Not applicable

Straight Table: sum(amount) when condition is fulfilled...

Just a small point - avoid using 'if' wherever possible as it has a perfomance overhead particularily with large amounts of data.

This should be more efficient:

sum(pick(match(Goods,'Cloths'), Amount))

Regrads,

Gordon

Community Browser