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

Adding a new sub dimension to an already existing dimension

Hi experts,

I am trying to figure out, how I can add a new element to an existing dimension. As in my case I have to generate a new variable if(WildMatch(Name, 'U-*', 'K-*','F-*'), 1, 0) as Flag_Projekt_UKF and add this to an existing dimension. 

I would like to do this in the script editor. Moreover, the above result Flag_Projekt_UKF  is generated based on table x1. Which means the dimension that has to be expanded by Flag_Projekt_UKF  is part of another table x2.

How can I do that with the help of a resident load. I really appreciate any help.

All the best,

dany_fr 

Labels (4)
2 Replies
edwin
Master II
Master II

this statement is confusing:  Moreover, the above result Flag_Projekt_UKF  is generated based on table x1. Which means the dimension that has to be expanded by Flag_Projekt_UKF  is part of another table x2.

however, to respond to the general question how to add new attributes to an existing dimension, you can do 1 of 2 things:

create a table with the unique values of the dimension + the new calculated attribute.

1. left join to the table where the dimension came from

2. or leave the generated table as it is - the association will take care of the linking.

//this creates the field attribute as a separate table
noconcatenate
FIELDATTRIBUTES:
load distinct FIELD, if(FIELD....) as FIELDATTRIBUTE resident X1;
//option2 stops here

//option1:
left join (X1)
load FIELD, FIELDATTRIBUTE resident FIELDATTRIBUTES;
drop table FIELDATTRIBUTES

 

dany_fr
Partner - Contributor
Partner - Contributor
Author

Thanks a lot Edwin. I could solve the problem in a different way.