4 Replies Latest reply: Jun 3, 2016 6:42 AM by Sasidhar Parupudi

converting fields as subfields

Hi I Have table like below...

 Soccer Teams League perfomence 2008 2009 2010 2011 2012 dallas Major won 15 20 17 22 19 dallas Major lost 7 5 7 3 4 sundowns PSL won 11 22 17 9 23 sundowns PSL lost 10 7 9 12 4 man city English won 25 28 31 22 20 man city English lost 8 5 3 7 11 G Rangers Scottish won 15 17 13 19 11 G Rangers Scottish lost 3 5 2 1 6 Real Madrid spain won 30 27 32 24 33 Real Madrid spain lost 3 5 4 10 2

I want to format as below.How can I do that in qlik sense ?

 Soccer Team League Results Season Perfomance dallas Major lost 2008 7 dallas Major lost 2009 5 dallas Major lost 2010 7 dallas Major lost 2011 3 dallas Major lost 2012 4 dallas Major won 2008 15 dallas Major won 2009 20 dallas Major won 2010 17 dallas Major won 2011 22 dallas Major won 2012 19 G Rangers Scottish lost 2008 3 G Rangers Scottish lost 2009 5 G Rangers Scottish lost 2010 2 G Rangers Scottish lost 2011 1 G Rangers Scottish lost 2012 6 G Rangers Scottish won 2008 15 G Rangers Scottish won 2009 17 G Rangers Scottish won 2010 13 G Rangers Scottish won 2011 19 G Rangers Scottish won 2012 11 man city English lost 2008 8 man city English lost 2009 5 man city English lost 2010 3 man city English lost 2011 7 man city English lost 2012 11 man city English won 2008 25 man city English won 2009 28

Thanks you

• Re: converting fields as subfields

Crosstable ‒ Qlik Sense

In this case, your script should look something like this:

CROSSTABLE(Season, Performance, 3)

[Soccer Team],

League,

Result,

[2008],

[2009],

...

FROM someSource

;

• Re: converting fields as subfields

temp1:

*

Inline

[

Soccer Teams,League,perfomence,2008,2009,2010,2011,2012

dallas,Major,won,15,20,17,22,19

dallas,Major,lost,7,5,7,3,4

sundowns,PSL,won,11,22,17,9,23

sundowns,PSL,lost,10,7,9,12,4

man city,English,won,25,28,31,22,20

man city,English,lost,8,5,3,7,11

G Rangers,Scottish,won,15,17,13,19,11

G Rangers,Scottish,lost,3,5,2,1,6

] ;

RENAME Field perfomence to Result;

CrossTable(Season,perfomence,3)

tabcross: