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

Splitting Dimension

Hello,

I have a  dataset with one of the columns that I would like to split into separate columns.

Column1
Age_18-29_yrs
Gender_male
Gender_female


into this:

Column1Column2 
 Age_18-29_yrs
Gender_male 
Gender_female 

 

Assuming there are more rows than the ones provided above. Is there a clean way of doing this without causing the database to bloat?

 

Thank you for your help

2 Solutions

Accepted Solutions
Seyko
Partner - Creator
Partner - Creator

Hello,

If you've some values, you can simply use a IF statement to create two distincts fields:

 

MyTab:
LOAD
IF (Column='Age_18-29_yrs', Column, NULL()) AS Column1,
IF (Column='Age_18-29_yrs', NULL(), Column) AS Column2,
* 
INLINE [
Column
Age_18-29_yrs
Gender_male
Gender_female
];

 

If you've multiples values, you can use match with mapping tables.

PS : Alternatively, you can also use these expressions to create calculated dimensions (masters items)

Excuse my english, i'm french!

View solution in original post

Stickman
Contributor II
Contributor II
Author

Thank you - I created calculated dimension.

View solution in original post

2 Replies
Seyko
Partner - Creator
Partner - Creator

Hello,

If you've some values, you can simply use a IF statement to create two distincts fields:

 

MyTab:
LOAD
IF (Column='Age_18-29_yrs', Column, NULL()) AS Column1,
IF (Column='Age_18-29_yrs', NULL(), Column) AS Column2,
* 
INLINE [
Column
Age_18-29_yrs
Gender_male
Gender_female
];

 

If you've multiples values, you can use match with mapping tables.

PS : Alternatively, you can also use these expressions to create calculated dimensions (masters items)

Excuse my english, i'm french!
Stickman
Contributor II
Contributor II
Author

Thank you - I created calculated dimension.