Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
a file excel is organized
Student Genuary February
Fabio 1100 2000
is it possibile transpose a row as column?
MONTH Student t
Genuary 1100
February 2000
Thanks
Hi Fabio, you can use CrossTable(), ie:
Data:
CrossTable(Month, Value)
LOAD Student,
Genuary,
February;
LOAD * Inline [
Student,Genuary,February
Fabio,1100,2000
];
This will create a table like:
Month | Student | Value |
---|---|---|
February | Fabio | 2000 |
Genuary | Fabio | 1100 |
Hello!
Look for CrossTable
Hi,
you might also load using * to avoid hard coded field names:
Data:
CrossTable(Month, Value)
LOAD * Inline [
Student,Genuary,February
Fabio,1100,2000
];
hope this helps
regards
Marco
to get a "real" Month field (no sorting/calculation issues!), you could extend this solution like:
Data:
CrossTable(MonthTemp, Value)
LOAD * Inline [
Student,Genuary,February
Fabio,1100,2000
];
Left Join
LOAD distinct
MonthTemp,
Month(Date#(MonthTemp,'MMMM')) as Month
Resident Data;
Drop Field MonthTemp;
because CrossTable() always treats column names as text.
To implement this solution you could have to define your LongMonthNames variable accordingly (if not already done):
SET LongMonthNames = 'Genuary,February, ... ';
hope this helps
regards
Marco