Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the data in vertical rows which i like to convert to horizontal data columns
Below is the screenshot of the sample of the input and the required output
The data is dynamically retrieved from the table and I like this conversion through load script
Can you pl provide some inputs in cross table usage in loadscript for this conversion
Thanks
Hi, Umashankar. To achieve this you can use Generic LOAD
GenTable: Generic Load NBR, Group, Count Resident InputTable;
ResultTable: LOAD Distinct NBR Resident InputTable;
FOR i = 0 to NoOfTables()
TableList:
LOAD TableName($(i)) as Tablename AUTOGENERATE 1
WHERE WildMatch(TableName($(i)), 'GenTable.*');
NEXT i
FOR i = 1 to FieldValueCount('Tablename')
LET vTable = FieldValue('Tablename', $(i));
LEFT JOIN (ResultTable) LOAD * RESIDENT [$(vTable)];
DROP TABLE [$(vTable)];
NEXT i
DROP TABLES TableList, InputTable;
Hi Umashakar,
Try to using pivot table you will get same.
Thanks,
Arvind Patil
Hi, Umashankar. To achieve this you can use Generic LOAD
GenTable: Generic Load NBR, Group, Count Resident InputTable;
ResultTable: LOAD Distinct NBR Resident InputTable;
FOR i = 0 to NoOfTables()
TableList:
LOAD TableName($(i)) as Tablename AUTOGENERATE 1
WHERE WildMatch(TableName($(i)), 'GenTable.*');
NEXT i
FOR i = 1 to FieldValueCount('Tablename')
LET vTable = FieldValue('Tablename', $(i));
LEFT JOIN (ResultTable) LOAD * RESIDENT [$(vTable)];
DROP TABLE [$(vTable)];
NEXT i
DROP TABLES TableList, InputTable;
Make use of the pivot. It'll be easier.
Hi,
Please check this.
Thanks for the response