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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

change the format of an excel sheet

Dear All,

I need ur help to create a loop  to change the position of rows in an excel sheet

let me explain1st table is the current format

DateFatherMotherDaughter
1/2/20141102044
1/3/20142112145
1/4/20143122246
1/5/20144132347
1/6/20145142448
1/7/20146152549
1/8/20147162650
1/9/20148172751
1/10/20149182852

the 2nd Table is the format i need

DateValues
Father1/2/20141
Father1/3/20142
Father1/4/20143
Father1/5/20144
Father1/6/20145
Father1/7/20146
Father1/8/20147
Father1/9/20148
Father1/10/20149
Mother1/2/201410
Mother1/3/201411
Mother1/4/201412
Mother1/5/201413
Mother1/6/201414
Mother1/7/201415
Mother1/8/201416
Mother1/9/201417
Mother1/10/201418
Daughter1/2/201420
Daughter1/3/201421
Daughter1/4/201422
Daughter1/5/201423
Daughter1/6/201424
Daughter1/7/201425
Daughter1/8/201426
Daughter1/9/201427
Daughter1/10/201428
12 Replies
MK_QSL
MVP
MVP

CrossTable(TYPE, VALUE, 1)

Load * Inline

[

Date, Father, Mother, Daughter

1/2/2014, 1, 10, 20, 44

1/3/2014, 2, 11, 21, 45

1/4/2014, 3, 12, 22, 46

1/5/2014, 4, 13, 23, 47

1/6/2014, 5, 14, 24, 48

1/7/2014, 6, 15, 25, 49

1/8/2014, 7, 16, 26, 50

1/9/2014, 8, 17, 27, 51

1/10/2014, 9, 18, 28, 52

];

Anonymous
Not applicable
Author

can you please explain more cuz i don't understand

alexandros17
Partner - Champion III
Partner - Champion III

Probably you could use a crosstable bat there is another way:

Table1:

read the file from xls;

TAbleFinal:

noconcatenate

Load 'Father' as Person, Date, Father as value resident Table1 ;

concatenate

Load 'Mother' as Person, Date, Mother as value resident Table1 ;

concatenate

Load 'Daughter' as Person, Date, Daughter as value resident Table1 ;

And you will have your table

Hope it helps

Anonymous
Not applicable
Author

i have more than 1000 values like mother &father i mean more than 1000 columns

is there a more automatic way ?

MK_QSL
MVP
MVP

Use this in script... you will get your result...

alexandros17
Partner - Champion III
Partner - Champion III

Then Use the crosstable as I said before, I think that Manish Kachhia code should work ...

Anonymous
Not applicable
Author

i can't open the document you sent can you please paste the code here

MK_QSL
MVP
MVP

Check my first reply

code is there

alexandros17
Partner - Champion III
Partner - Champion III

this is the script

CrossTable(Person, Value)

LOAD Date,

     Father,

     Mother,

     Daughter

FROM

[AAA.xlsx]

(ooxml, embedded labels, table is Foglio1);

Where AAA.xlsx is youur excel file