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

New field/ Demension from field values

I have a field call class code and there are multiple values RR1,RR2,RR3,IG1,IG2,IG3,CA1,CA2,CA3,CA4.

i have to get the sum of sales for all a group of values for example all RR values.

I know i could use set analysis to define it for the expression but i cam trying to put it in a chart and have the group of values act like a field/dimension. So i would have 1 expression Sum(sales) and then dimensions RR,IG,CA all in a straight table.

Is it possible to create new fields or dimensions from field values ?

 

Thanks,

 

2 Replies
waszcma1
Partner - Creator II
Partner - Creator II

Hi,

My first thought is:

In the loading data script create another field which will flag the records.

use this:

if(wildmatch([class code],'RR*'),'RR',if(wildmatch([class code],'IG*'),'IG','CA')) as Code_Flag

Now you have new dimension named Code_Flag 

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In a chart, you could add a dimension as:

=left([Class Code],2)

Or do the same in the script to derive a new field.

-Rob