Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Applicable88
Creator III
Creator III

Rename dimensions with if and add another condition

Hello,

I have Errorcodes as a dimension, but out of comfort and since codes not telling you much, the user wants to see the description instead,

so I use If-Statements to rename them as a string:

=if([Errorcode]='X350','Material not available',
if([Errorcode]='X351','No Material in stock',
if([Errorcode]='X352','No build in stock,
if([Errorcode]='X354','Failure in System',
if([Errorcode]='X356','Interface problem', 'Other kind of failure' )))))

It works well in a bar-chart, but now I have the problem that I also see the dimensions of certain codes when there is no code given. For example if I filter a specific date or timeperiod and have no count for 'X354' it  still will show me a zero value.

But I don't want zero values to be displayed at all.  I already tried to uncheck "Include Null-Values" in the bar chart options,  but it also doesn't work, because its not a null subset in the data. The value is simply zero.

Since I have plenty more of error codes to translate into string, the barchart becomes very large. How can I filter all zero values out, within a if statement without to loose the option to rename to a string? If there is other options for that, please let me know. 

Thanks in advance. 

 

1 Solution

Accepted Solutions
QlikTom
Employee
Employee

In the Dimension setting, you are electing to display NULL values or not. 
In the Data Handling setting, you are electing to display ZEROs or not. 

As NULL  != 0,  two different settings are available. 

I hope this clarifies things a little bit. 

View solution in original post

3 Replies
QlikTom
Employee
Employee

Take a look under Add-ons > Data handling in the bar chart properties, you should see a toggle for "include zero values"

qliktom_0-1593440964485.png

I would suggest instead if doing a calculated dimension, adding a table to the data model with the codes and descriptions, using the Code as the key in the new table. It might save you time in the future and simplify things going forward. 

 

Applicable88
Creator III
Creator III
Author

Hello @QlikTom ,

thanks for our reply.

I'm very surprise there is another checkbox other than already in the "dimension" for 'include zero values'

Can you tell me what is the difference from that in the dimension and in add-ons Data handling?

 

QlikTom
Employee
Employee

In the Dimension setting, you are electing to display NULL values or not. 
In the Data Handling setting, you are electing to display ZEROs or not. 

As NULL  != 0,  two different settings are available. 

I hope this clarifies things a little bit.