Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Use this expression.

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

7 Replies
alexandros17
Partner - Champion III
Partner - Champion III

try this

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

)

hope it helps

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Use this expression.

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

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

Not applicable
Author

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

Not applicable
Author

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

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try the one i had shown in above post.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Many thanks

now work perfectly