Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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?

Labels (1)
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;