Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rename Null Value Using A Calculated Dimension

In a straight table, how do I replace '-' for null value with the word 'Unlisted'?

Example:

Current output

Dimension     Revenue

John              $20

Brian              $100

Fred               $45

-                     $5

Proposed output

Dimension     Revenue

John               $20

Brian               $100

Fred               $45

Unlisted          $5   

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try if(len(trim(Dimension))=0,'Unlisted',Dimension)

But it's better to do this in the script. That will give better performance in the charts. And nulls cannot be selected so replacing nulls with real values if possible is always a good idea.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Try if(len(trim(Dimension))=0,'Unlisted',Dimension)

But it's better to do this in the script. That will give better performance in the charts. And nulls cannot be selected so replacing nulls with real values if possible is always a good idea.


talk is cheap, supply exceeds demand
Not applicable
Author

I agree with Gysbert, probably better to move this to the import script. This would also work on import:

if(isnull(Dimension),'Unlisted',Dimension) as Dimension

Best,

Matt

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you need this in all the charts then you should do this in script itself, because the calculated dimension has performance issues.  As matt suggested do this in the script by using

LOAD

     *,

     If(IsNull(DimensionName), 'Unlisted', DimensionName) AS DimensionName

FROM Source;

Hope this helps you.

Regards,

Jagan.