Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
NurulAin
Contributor II
Contributor II

Replace dimension name in Bar chart

Hi, i have the following charts and need to change the dimension name "Not applicable" to "HUB" and "Papua New Guinea" to "PNG". Can someone show me how to go about this? 

Dimension used in this is "Market".

1.jpg

10 Replies
Gysbert_Wassenaar

You can use a calculated dimension in which you replace the values with other values using an if statement. But a better solution is to replace the values in the load script. Or create an extra field in the load script where you replace the values.

talk is cheap, supply exceeds demand
NurulAin
Contributor II
Contributor II
Author

Hi Gysbert, could you share with me how to do the if statement or what to type in the script?

Gysbert_Wassenaar

LOAD
If(Market = 'Not Applicable', 'HUB', If(Market = 'Papua New Guinea', 'PNG',Market)) as Market,
...other fields...
FROM ...source....


talk is cheap, supply exceeds demand
NurulAin
Contributor II
Contributor II
Author

I tried to follow this script, but when i reload there is an error message as in the picture. what did i do wrong?

LOAD

If(Market = 'Not Applicable', 'HUB', If(Market = 'Papua New Guinea', 'PNG')) as Market

From [C:\Users\nain\Digicel Caribbean Ltd\Performance Transformation Pacific - Documents\03 Reports\05 Tracker WAVE\00 Archive - Latest Data\Latest data - Wave - 20190113 (17h39m).xlsx];

script error.jpg

bvssudhakar
Creator III
Creator III

Hi @Gysbert_Wassenaar

Can you please write it as calculated dimension also because i want to know how to write in calculated dimension in this type condition 

 

Thank you in advance

B V S Sudhakar

bvssudhakar
Creator III
Creator III

Hi @NurulAin

 

Can you please share your Script

Gysbert_Wassenaar

Replace 'Market' with the name of the field that contains the values you want to replace.


talk is cheap, supply exceeds demand
bvssudhakar
Creator III
Creator III

Hi @NurulAin

Sorry not script, Share your Excel file

Gysbert_Wassenaar

=If(Market = 'Not Applicable', 'HUB', If(Market = 'Papua New Guinea', 'PNG',Market))
And again use the real field name if it's not named Market.


talk is cheap, supply exceeds demand