Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

markgraham123
Valued Contributor

Sum() in the If Condition

Hi all,

I was trying to sum the filed grouped by name in the if loop.

=If(Status=1,Sum(Aggr([Amount],Name)))

This is not giving any result.

Can someone please help here

1 Solution

Accepted Solutions
Highlighted

Re: Sum() in the If Condition

11 Replies
Highlighted

Re: Sum() in the If Condition

May be this:

Sum({<Status = {1}>} Aggr(Only({<Status = {1}>} Amount), Name))

Highlighted
markgraham123
Valued Contributor

Re: Sum() in the If Condition

It's just giving 0 sunny.

Highlighted

Re: Sum() in the If Condition

Would you be able to share a sample?

Highlighted
kkkumar82
Valued Contributor III

Re: Sum() in the If Condition

Hi

Can you put some dummy data.

Thanks

Kiran Kumar

Highlighted
neetha_p
Honored Contributor

Re: Sum() in the If Condition

Hi Mark,

Please try:

Sum(Aggr(Sum({<Status = {1}>} Amount), Name))

Highlighted
markgraham123
Valued Contributor

Re: Sum() in the If Condition

!Here is the sample application..

I was trying to do the calcualtions using the variables.

Highlighted
neetha_p
Honored Contributor

Re: Sum() in the If Condition

Hi Mark,'

Only function returns 0(Zero) if they is more than one value for a dimension

Regards

Neetha

Highlighted

Re: Sum() in the If Condition

Highlighted
markgraham123
Valued Contributor

Re: Sum() in the If Condition

Sunny its working for me.

Also, i'm trying to store the value of the Column's total in chart to a variable...

I can do it by storing the expression in Variabloe.

But due to req. constraints i wanna do it the other way.

Can we do it?