Rename dimensions with if and add another condition
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.
Take a look under Add-ons > Data handling in the bar chart properties, you should see a toggle for "include zero values"
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.