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

How do I change value labels in a dimension?

Hi,

I have the individual brands for my company as a dimension in this chart, against the year's sales as an expression.  I'm trying to find out if there is a way to change the value labels on this dimension, so that instead of reading "T" and "S" etc, it reads the full names of the brands.  Is this possible?

Thanks

orders national screenshot 5 for Qlik comm.jpg

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you want to keep script code changes few and small, add the Mapping table from Vishwarath's example here:Re: How do I change value labels in a dimension? to the end of your script, but omit the MAPPING Keyword and change the field names into Order Brand and Order Brand Name for example. Reload and change the dimension of your chart from Order Brand into Order Brand Name.


Best way is to add all possible Brands and their names to your INLINE table, as future loads may include data for additional products/brands that aren't present right now.


Best,


Peter

View solution in original post

10 Replies
marcus_sommer

Why not just using the full-names as dimension? If they aren't loaded yet the you could add them to an existing table or maybe create a new associated dimension-table for it.

- Marcus

vishsaggi
Champion III
Champion III

Why dont you use Apply map in your script for the Brand and use it in Dimension. Like:

MAPPING:

MAPPING LOAD * INLINE [

Brand, Name

T, 'TTTT'

S, 'SSSS'

J, 'JJJJ'

];

LOAD col1, col2, ApplyMap('MAPPING', Brand) AS BrandName

FROM yoursoucetable;

Anonymous
Not applicable
Author

I would use the full names as a dimension, but the raw data doesn't contain the brand names.  I'd have to run the original SAS query again, which would take hours.  I might try an associated dimension table, though.

Anonymous
Not applicable
Author

I'm just trying this out now, takes a while to reload so I don't know if it works yet. 

Where you've put LOAD col1, col2 etc., should I substitute these columns with something specific?  I'm just not familiar with the syntax of 'ApplyMap'.

vishsaggi
Champion III
Champion III

Your

Load Col1 and Col2 are just other additional fields you are pulling from your actual data source table, just replace them with your actual fields.

Can you tell me the from where you are pulling this full names? Do you have a sample script to share? 

Anonymous
Not applicable
Author

The names aren't stored anywhere, they're just in the data as letters rather than names. 

So, do you mean to load all the fields from the original data source?  Or just the relevant ones?  It's just that in the initial load the source table had over 100 fields

marcus_sommer

I wouldn't be surprised if such dimension-table already exists within your database - ask simple the database admin. If there is really not such a table you don't need to load the whole table for it - only these two fields within a distinct load which shouldn't run very long.

Beside them if you are handling with rather large and long-running sql-queries you should consider to use incremental approaches with storing the results in qvd's and loading afterwards only new and changed values from the database. Within the last two links-blocks here: Advanced topics for creating a qlik datamodel you will find several useful links for incremental loading and usings optimized loads.

- Marcus

vishsaggi
Champion III
Champion III

Ok, are those letters have some fullnames somewhere? If yes, try store them in an excel and use apply map in your script. When you say letters you mean Brand is your field and those letters are values of your field Brand? Correct me. Try to pull only fields that are necessary into your dashboard, I am sure you have some specific fields to be used in your dashboard rather than all 100 fields. Give us more information if possible.

Anonymous
Not applicable
Author

The full names do exist, and I could type them onto an excel spreadsheet if it would help. 

Yes, the field is called Order Brand (Order is the prefix of the Order table) and these letters are the only values of this field.  If I'm honest, I don't actually know what the other fields are used for.  The app is quite large, and I'm only working on the landing page.  There are dozens of other tabs with complicated analyses going on, so I can't risk dropping any fields. 

In essence, the main table for the app is the Order table.  It contains data about sales across the whole company over the last two years.  Linked with it are the following tables: Customer, Order_Branch, SKU, Calendar.