Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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 |
the 2nd Table is the format i need
Date | Values | |
Father | 1/2/2014 | 1 |
Father | 1/3/2014 | 2 |
Father | 1/4/2014 | 3 |
Father | 1/5/2014 | 4 |
Father | 1/6/2014 | 5 |
Father | 1/7/2014 | 6 |
Father | 1/8/2014 | 7 |
Father | 1/9/2014 | 8 |
Father | 1/10/2014 | 9 |
Mother | 1/2/2014 | 10 |
Mother | 1/3/2014 | 11 |
Mother | 1/4/2014 | 12 |
Mother | 1/5/2014 | 13 |
Mother | 1/6/2014 | 14 |
Mother | 1/7/2014 | 15 |
Mother | 1/8/2014 | 16 |
Mother | 1/9/2014 | 17 |
Mother | 1/10/2014 | 18 |
Daughter | 1/2/2014 | 20 |
Daughter | 1/3/2014 | 21 |
Daughter | 1/4/2014 | 22 |
Daughter | 1/5/2014 | 23 |
Daughter | 1/6/2014 | 24 |
Daughter | 1/7/2014 | 25 |
Daughter | 1/8/2014 | 26 |
Daughter | 1/9/2014 | 27 |
Daughter | 1/10/2014 | 28 |
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
];
can you please explain more cuz i don't understand
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
i have more than 1000 values like mother &father i mean more than 1000 columns
is there a more automatic way ?
Use this in script... you will get your result...
Then Use the crosstable as I said before, I think that Manish Kachhia code should work ...
i can't open the document you sent can you please paste the code here
Check my first reply
code is there
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