Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
caiomartins
Contributor II
Contributor II

Create new Columns without Pivot on Transformation - Script?

Hi everyone, 

I am fairly new to Qlik sense but I already have a fairly big assignment to accomplish here.

Right now, my data is a join between two tables, whereas one table is a single row with around 70 columns.

The problem is that I need to create two tables, and these two tables would need to come from two variables, as my dataset for this is a single row. 

 

Example:

My current data is like this: 

Var 1 | Var 2 | Var 3 … | Var 35 | Var 36 | Var 37 | Var 38 |Var 39  |Var 40 |Var 41 | Var 42 |Var 43| Var 44 | Var 45 | …. | Var 70

 

Each of these columns have a single entry only.

 

I need to keep my Original file intact, all the columns up to Var 34.

 

But I would like to create two 4 columns where they would be:

 

X | Y (since the entries between Variable 40 and 45 are results for Variables between 34 and 39)

Var 34, Var 40

Var 35, Var 41

Var 36, Var 42

Var 37, Var 43

Var 38, Var 44

Var 39, Var 45

 

Moreover, this situation repeats itself between Variable 46 and Variable 55. Then I would need two new variables as

 

W | Z

Var 46, Var 52

Var 47, Var 53

Var 48, Var 54

… and so on.


I imagine that I would need to use the script to perform this transformation and create the variables. However, I am not sure how. Would anyone be able to help me here, please?

Thank you very much!

Labels (3)
1 Reply
Vishal_Gupta
Partner - Creator
Partner - Creator

Hi @caiomartins 

Can you explain the problem with the help of some sample data or screenshot?

If a post helps to resolve your issue, please accept it as a SOLUTION and leave a LIKE!