Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

If Then Else with Sum Not Working

Help, I am new to Qlikview and ready to go crazy.

I have SQL and .NET experience and I am trying to do something that is so easy using those tools.

In my QVW document, I have a chart, and within that chart I am trying to build an Expression.

Here is the simple English:

If the rProcedure Class Code field has a value of 'MR', then sum the numeric value of the rUnits field.

Here is the QV syntax.

If([rProcedure Class Code])='MR', Sum(rUnits))

I get an Expression OK, but the If Then Else seems to have no effect on my chart.

If I do not do the If Then Else, and simply sum rUnits, I get desired results.

I also tried doing an UPPER and TRIM, in case there were any extra characters or mixed case characters, with no success. And I checked the table for the existance of 'MR' and it was there. Seems so simple. What am I doing wrong?

Thanks,

Bob

Tags (4)
4 Replies
jykang0638
Not applicable

If Then Else with Sum Not Working

Hi Bob,


You should use like this:

Sum(If([rProcedure Class Code]='MR', rUnits))
or
Sum({<[rProcedure Class Code]={'MR'}>} rUnits)


The second expression is using set analysis syntax.
It's very powerful functionality and useful.
You can refer it in the Help menu or reference manual.


I hope it will help you.

Steve Kang.

jagan
Not applicable

If Then Else with Sum Not Working

Hi,

The below expression works

Sum(If([rProcedure Class Code]='MR', rUnits))

or

Sum({<[rProcedure Class Code]={'MR'}>} rUnits)

If not, attach sample data.  This helps in finding the solution.

Regards,

Jagan.

Not applicable

If Then Else with Sum Not Working

Thanks! This worked fine .....

I just posted another question about automatically opening an external web page in a QV sheet, that is, the user does not click a link, rather, when entering the page, the web page "self deploys" to the sheet. Do you know anything about that?

Thanks again,

Bob

Not applicable

If Then Else with Sum Not Working

Hi, this worked. Thanks for your help! .... Bob