Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Ron1
Partner - Creator
Partner - Creator

How can I change my rown in to column and columns to rows

Can someone please help me to acheive the below in script editor. Input has been shared,required output structure has also mentioned

Input:

WeekNbrTakingsTurnOverTTTT2
WK120010024
WK23002001.53
WK338038012
WK442014036

 

Expected Output structure:

TypeWK1WK2WK3WK4
Takings    
TurnOver    
TT    
TT2    
4 Replies
Kushal_Chawda

check out  crosstable load to transform your column to row. Then you can use the pivot table to present your output

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

Ron1
Partner - Creator
Partner - Creator
Author

The problem is I will use Vizlib writeback table to show the data, so I have to convert my input structure into the required output structure at the script level only

Ron1
Partner - Creator
Partner - Creator
Author

Can anyone please help. I need the entire structure to be created in Script itself

Kushal_Chawda

try below

Data:
CrossTable(Type,Values)
 LOAD WeekNbr,
     Takings, 
     TurnOver, 
     TT, 
     TT2    
FROM
[https://community.qlik.com/t5/Qlik-Sense-App-Development/How-can-I-change-my-rown-in-to-column-and-columns-to-rows/td-p/1737710]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);

New:
Generic LOAD 
             Type,
             WeekNbr,
             Values             
Resident Data;

DROP Table Data;

 

Annotation 2020-08-21 130459.png