Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Generic Load

Hi guys,

I've been working on this for over the last  two days and I got so many help but I am still not able to complete it.

I have a table that shows data as attached sample.

Is there anyway i can do a Generic load to load data correctly

The unique Key should be raw ID

Raw Id     record ID     (Values of Custom Field Label)     (Values of Custom Field Value)

20932     48421          CV1  CV2   CV3 CV4........          V1..V2..V3..V4.....

26746     48048          CV1  CV2   CV3 CV4....              V1..V2..V3..V4...

26747     48048          CV1  CV2   CV3 CV4....              V1..V2..V3..V4...

And so on.

1 Solution

Accepted Solutions
whiteline
Master II
Master II

What is exactly your problem ?

The possible solution has been posted.

Another thing to try is not to drop tables in the same loop with joins.

Drop It later in a second loop.

Found it. Your problem as I said was spaces.

Your previous code works perfect, you should just use [] with table name.

FOR i = 1 to FieldValueCount('Tablename')

     LET vTable = FieldValue('Tablename', $(i));

     LEFT JOIN (result) LOAD * RESIDENT [$(vTable)];

     DROP TABLE [$(vTable)];

NEXT i

View solution in original post

2 Replies
whiteline
Master II
Master II

What is exactly your problem ?

The possible solution has been posted.

Another thing to try is not to drop tables in the same loop with joins.

Drop It later in a second loop.

Found it. Your problem as I said was spaces.

Your previous code works perfect, you should just use [] with table name.

FOR i = 1 to FieldValueCount('Tablename')

     LET vTable = FieldValue('Tablename', $(i));

     LEFT JOIN (result) LOAD * RESIDENT [$(vTable)];

     DROP TABLE [$(vTable)];

NEXT i

alec1982
Specialist II
Specialist II
Author

hi,

thanks for your help.

I don't think the spaces are causing the issue.

Simply this code got me what i need:

original:

LOAD RecordId,

    CustomFieldSection,

    RowId,

    CustomFieldLabel,

    CustomFieldValue

FROM [..\data\harborflex\hbdata.xml] (XmlSimple, Table is [PortfolioExportData/tblCustomFieldValue])

Where CustomFieldSection='Office Composition';

temp1:

generic load * resident original;

drop table original;

Thanks,