Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
annalisa_carado
Partner - Contributor II
Partner - Contributor II

for each in script

Hi all, I have a question about this situation:

I have this table :

   

KeyMeasureAMeasureBMeasureC
AAAAA1020

30

and I want a final table like this:

  

KeyMeasure  Value
AAAMeasureA10
AAAMeasureB20
AAAMeasureC30

I wrote the static solution:

TMP:

load

Key,

'MeasureA' as Measure,

MeasureA as Value

resident MyTable;

Concatenate

load

Key,

'MeasureB' as Measure,

MeasureB as Value

resident MyTable

.....

I would like to get this dinamyc (maybe in future will have new dimensions), using for each next .. but i'm not having success.

Any help?

2 Replies
Anonymous
Not applicable

Try cross table Annalisa.

crosstable(measure,Value,1)

Load * from <your initial table>;

MK_QSL
MVP
MVP

CrossTable (Measure, Value)
Load

     Key,

MeasureA,

MeasureB,

MeasureC

From TableName;