Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys
I have a task , while evaluating students Grades .
I get a table with those columns ID, Seminar, grade
like this
ID, Seminar, grade
100,210,85
101,210,95
100,205,75
101,205,92
very long data lines .
I need to create the seminar as a columns name and the garde as data
should look like this
ID,205,210
100,75,85
101,92,95
enclosed is a file of data .
any idea how to do it , the seminars varies every year .
thanks
gidon
You can re-join your tab.* tables into a single table named "Final" like this:
// Collect the ID field in a new table
Final:
LOAD Distinct ID
FROM
FOR i = NoOfTables()-1 to 0 STEP -1
LET vTable=TableName($(i));
IF WildMatch('$(vTable)', 'tab.*') THEN
LEFT JOIN (Final) LOAD * RESIDENT [$(vTable)];
DROP TABLE [$(vTable)];
ENDIF
NEXT i
-Rob
Within the script you could transform your table per The Generic Load into your descriped data-structure. But it might not always necessary to do this - maybe a pivot-chart within the gui will be sufficient for it.
- Marcus
Hi David,
I guess use Genaric prefix of Load.
genaric is used for kind of genaric databases.
Regards
Pavan
Hi thanks
I did this
tab:
Generic LOAD ID, Seminar, Grade
FROM
I got many tables
$Table |
tab.311116 |
tab.311117 |
tab.311126 |
tab.311131 |
tab.311301 |
tab.311119 |
tab.311125 |
tab.311128 |
tab.311132 |
tab.311302 |
I need to concatenate them with the ID , How can I do it ?
when I do not know the exact no. of tables the function will create and the names ?
any Idea
thanks
gidon
You can re-join your tab.* tables into a single table named "Final" like this:
// Collect the ID field in a new table
Final:
LOAD Distinct ID
FROM
FOR i = NoOfTables()-1 to 0 STEP -1
LET vTable=TableName($(i));
IF WildMatch('$(vTable)', 'tab.*') THEN
LEFT JOIN (Final) LOAD * RESIDENT [$(vTable)];
DROP TABLE [$(vTable)];
ENDIF
NEXT i
-Rob