Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I am trying to convert the values of a particular variable to a string.
I have a variable that looks like this:
Location
101
102
103
...etc.
but I want it to look like this:
Location
'Hawaii'
'New York'
'Chicago'
...etc.
The problem I am running into is that my variable has over 100 different options, so I am finding that QlikView will not allow me to create a calculated dimension like:
=IF(Location=101,Hawaii'
IF(Location=102,'New York')) etc. for more than 99 locations. It gives me an error message if I go past 99 "if" statements.
Is there a different way to do what I want? Do I need to edit the variable values in the script, and if so, how would I do that?
Thanks!!
You can use a table to map your values:
Are you talking about field Location. ?
You can use a mapping table from excel sheet.
Can you tell us from where are you getting this Location information from i mean the ID's and the LocationNames? Is it coming from an excel sheet, if Yes, you can use Mapping functions.
MAPTABLE:
MAPPING LOAD LocID, LOCATION
FROM yourexcelfilename.xlsx.
ACTUALTAB:
LOAD col1, col2, Applymap('MAPTABLE', LocID) AS Location
FROM yourdatasource;
Hi,
You can try to implement mapping table
Don't join - use Applymap instead
I am attaching an example as well.
Hope this helps.