Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
Not applicable

What's wrong with my if syntax? :(

Hi,

I have a table of account information (from Salesforce) in QV. Each account has an Account ID and Account Status (Customer, Lost Customer, Work in Progress, etc).

I wanted to create an expression that would return 1 if an account was in Customer status and 0 else. This is the expression I used:

if(([Account Status]='Customer'),1,0)

for some reason, when I create a straight table with Account ID as dimension and the expression above as the expression, QV would only show the Accounts with 1 (i.e. the customers), and not all the others. This persists of course after hitting clear.

What am I doing wrong?

Thanks!

Al

1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

Go to Presentation tab in the stright table -> Uncheck Suppress zero values and click Ok, You would see the results correctly.

View solution in original post

9 Replies
Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

Hi Al,

may be you can check what QV does about missing or zero values. (hidding ?)

best regards

Chris

Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

Try this:
If([Account Status]='Customer',1,0)

Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

Go to Presentation tab in the stright table -> Uncheck Suppress zero values and click Ok, You would see the results correctly.

View solution in original post

Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

so basic, so simple, how embarassing thanks a lot!

Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

Hi,

Try to add another expression like "Only({1} [Account ID])" and hide this column from Presentation tab.

Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

that works as well (along with unchecking the suppress zero values box).

What's the difference? Which is better?

thanks

Highlighted
MVP & Luminary
MVP & Luminary

Re: What's wrong with my if syntax? :(

Hi,

Qlikview suppresses zero values, if you want then

Chart Properties -> Presentation -> Uncheck Supress zero values

or use this expression

If([Account Status]='Customer','Customer', 'Non Customer')


Hope this helps you.


Regards,

Jagan.

Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

yup, that's it! Thanks a lot

Highlighted
Not applicable

Re: What's wrong with my if syntax? :(

yes, that's it. I don't have any more 'helpful answer' stars to give, sorry