Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Simple Dimension Expression Issue

So this is probably a really easy question to answer, but didn't find anything in a search:

I have a List Box that splits my data into two categories - Y and N.

I want to put in a bar graph that shows both the Yes and the No data. I thought an if() statement would be appropriate but can't seem to get the correct expression that QV would like. I think it has something to do with my input after the '=' sign...

=if(PuttableF=N, 'No',if(PuttableF=Y, 'Yes','Neither'))



1 Solution

Accepted Solutions
MVP
MVP

Simple Dimension Expression Issue

Hello,

If PuttableF is a field that contains "Y" or "N", then use it as dimension, and do a Count(Field) where Field is any field related to those Y or N.

Anyway, check some missing single quotes in your expression:

=if(PuttableF = 'N', 'No', if(PuttableF = 'Y', 'Yes', 'Neither'))


Note that conditional based calculated dimensions will take a lot of time to render, so avoid them whenever possible.

Hope this helps.

3 Replies
MVP
MVP

Simple Dimension Expression Issue

Hello,

If PuttableF is a field that contains "Y" or "N", then use it as dimension, and do a Count(Field) where Field is any field related to those Y or N.

Anyway, check some missing single quotes in your expression:

=if(PuttableF = 'N', 'No', if(PuttableF = 'Y', 'Yes', 'Neither'))


Note that conditional based calculated dimensions will take a lot of time to render, so avoid them whenever possible.

Hope this helps.

Not applicable

Simple Dimension Expression Issue

Thanks Miguel, the single quotes worked. I have a pretty nice sized if() statement dimension already in the chart (and noticed the difference in time it took to save/open the file). But doesn't the count() function just give the number of Y or N values and not the values themselves? I need to display the actual values too.

Highlighted
MVP
MVP

Simple Dimension Expression Issue

Well, it depends on how you have built your data model.

To get the count of fields with Y or N, you can use

Count({< PuttableF = {'Y'} >} ID)


For "Neither", you can try (although I don't know how it will work)

Count({1 - < PuttableF = {'Y', 'N'} >} ID)


Hope this helps

Community Browser