I have requirement where one of my field values need to be converted to fields and their status should appear as their values
I used generic load to get my requirement but in the process i got the result without generic load
I have field named Process where it has around 40 values and theirs statuses are in different field named as Status
It looks as below and i have primary field named as ID
Instead of Generic load i used below code to get the expected result
InitialTable:
LOAD
"ID",
Process1,
Status1
resident Processes;
FinalTable:
LOAD ID
Resident InitialTable;
FOR i = 0 to FieldValueCount('Process1')-1
LET vField = FieldValue('Process1', $(i));
If '$(vField)' <>'' then
Left Join (FinalTable)
LOAD ID,
Status1 as [$(vField)]
Resident InitialTable
Where Process1 = '$(vField)';
end if;
NEXT i
DROP Table InitialTable;
I got the result as below after execution
No comments:
Post a Comment