7 Replies Latest reply: Mar 11, 2013 5:58 AM by cwdeveloper

Problem with if sum

I all

i'm new of qlik if someone help me pleas

I would like have a total amount with  condition

Example

Month, Budget, Sales

Gen,100.25

Feb,100,25,

Mar,100,0

Apr,100,0

etc

The total that i would like obtain is 250.

I used the follow expression but the total that i obtain is 400   or 50

if (sum(Sales)>0,sum(Sales), sum(Budget) )

Many thanks

PT

• Re: Problem with if sum

try this

if (sum(Sales)>0,sum(Sales) + sum(Budget), sum(Budget)

)

hope it helps

• Re: Problem with if sum

No in this case the total is the sumo of both colums (total 450)

I wold like sum sales if exist otherwise sum budget

Thanks

• Re: Problem with if sum

Try the one i had shown in above post.

Regards,

Kaushik Solanki

• Re: Problem with if sum

No in this case the total is the sumo of both colums (total 450)

I wold like sum sales if exist otherwise sum budget

Thanks

• Re: Problem with if sum

No in this case the total is the sumo of both colums (total 450)

I wold like sum sales if exist otherwise sum budget

Thanks

• Re: Problem with if sum

Hi,

Use this expression.

sum(aggr(if(sum(Sales)>0,sum(Sales), sum(Budget)),Mese))

Regards,

Kaushik Solanki

• Re: Problem with if sum

Many thanks

now work perfectly