# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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.

Tags (2)
1 Solution

Accepted Solutions
Highlighted
MVP

I see this:

11 Replies
Highlighted
MVP

## Re: Sum() in the If Condition

May be this:

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

Highlighted
Valued Contributor

## Re: Sum() in the If Condition

It's just giving 0 sunny.

Highlighted
MVP

## Re: Sum() in the If Condition

Would you be able to share a sample?

Highlighted
Valued Contributor III

## Re: Sum() in the If Condition

Hi

Can you put some dummy data.

Thanks

Kiran Kumar

Highlighted
Honored Contributor

## Re: Sum() in the If Condition

Hi Mark,

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

Highlighted
Valued Contributor

## Re: Sum() in the If Condition

!Here is the sample application..

I was trying to do the calcualtions using the variables.

Highlighted
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
MVP

## Re: Sum() in the If Condition

I see this:

Highlighted
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?