Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
agni_gold
Specialist III
Specialist III

How to remove synthetic keys from generic load ?

I have applied simple generic load , it makes lot of tables (for that field values) and synthetic keys , how can i remove them ?

  

 

IDNameRateRegionValue
1Agnivesh3Delhi10
2Kumar6Delhi15
3Kanpur9Jaipur20
4UP12Lucknow25
5LKO15Lucknow30
Need Output Like
IDNameRateDelhiJaipurLucknow
1Agnivesh310
2Kumar615
3Kanpur9 20
4UP12 25
5LKO15 30

So i have done Simply

A:

Generic LOAD ID,     

     Rate,     

     Name,

     Region,

     Value

FROM

(ooxml, embedded labels, table is Sheet2);

1 Solution

Accepted Solutions
satishqlik
Creator II
Creator II

Hi

You can achieve by this

inputtab:

LOAD id,

     name,

     rate,

     region,

     value

FROM

C:\Users\admin\Desktop\QV\genricload.xlsx

(ooxml, embedded labels, table is Sheet1);

gentab:

Generic

LOAD id,

     name,

     rate,

     region,

     value

     Resident inputtab;

    

resulttab:

LOAD Distinct id,name,rate Resident inputtab;

FOR i=0 to NoOfTables()

tablelist:

LOAD TableName($(i)) as tablename AutoGenerate 1

Where WildMatch(TableName($(i)),'gentab.*');

NEXT i

FOR i=1 to FieldValueCount('tablename')

LET Vtable=FieldValue('tablename',$(i));

Left Join (resulttab)

LOAD * Resident [$(Vtable)];

DROP Table [$(Vtable)];

NEXT i

DROP Tables tablelist,inputtab; 

I hope this helps you!

Rgs

satish

View solution in original post

1 Reply
satishqlik
Creator II
Creator II

Hi

You can achieve by this

inputtab:

LOAD id,

     name,

     rate,

     region,

     value

FROM

C:\Users\admin\Desktop\QV\genricload.xlsx

(ooxml, embedded labels, table is Sheet1);

gentab:

Generic

LOAD id,

     name,

     rate,

     region,

     value

     Resident inputtab;

    

resulttab:

LOAD Distinct id,name,rate Resident inputtab;

FOR i=0 to NoOfTables()

tablelist:

LOAD TableName($(i)) as tablename AutoGenerate 1

Where WildMatch(TableName($(i)),'gentab.*');

NEXT i

FOR i=1 to FieldValueCount('tablename')

LET Vtable=FieldValue('tablename',$(i));

Left Join (resulttab)

LOAD * Resident [$(Vtable)];

DROP Table [$(Vtable)];

NEXT i

DROP Tables tablelist,inputtab; 

I hope this helps you!

Rgs

satish