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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Binary load data reduction and concatenate

Hi All,

Please help needed with binary load data reduction:

Used below script to reduce data based on different users for different months and concatenated:

Binary ;

for each vTable_Field in 'EmpDetails,EMPID','EMPLOYEE,EMPID', 'COUNTRY,[COUNTRY ID]'
let vTable = subfield(vTable_Field,',',1);
let vField = subfield(vTable_Field,',',2);

INNER JOIN ($(vTable))
LOAD DISTINCT $(vField)
Resident EmpDetails
Where NAME = '$(vName1)' and MonthYear = 'MAR 2016';
next vTable_Field
Concatenate
INNER JOIN ($(vTable))
LOAD DISTINCT $(vField)
Resident EmpDetails
Where NAME = '$(vName2)' and MonthYear = 'APR 2016';
next vTable_Field

it gives illegal prefix error for concatenate keyword.

if I remove concatenate, it loads only data for user 2,but I want to load data for both user 1 for march month  and user 2 for april month

Thank for help

Neetha

1 Solution

Accepted Solutions
sunny_talwar

I think you have Inner Join and Concatenate next to each other. Do you want to concatenate or do a Inner join? May be you want to remove the inner join?

View solution in original post

8 Replies
sunny_talwar

I think you have Inner Join and Concatenate next to each other. Do you want to concatenate or do a Inner join? May be you want to remove the inner join?

Anonymous
Not applicable
Author

hi sunny,

thanks for response.

I want to inner join and merge data, other than concatenate how to merge both tables from data reduction?

Kushal_Chawda

Instead of using For, why don't you simply load the field name from required table and concatenate them

Data:

LOAD * inline [

Junk ];

Concatenate(Data)
LOAD DISTINCT

                      EmpDetails,EMPID,

                     EMPLOYEE,EMPID,

                     COUNTRY,

                     [COUNTRY ID]
Resident EmpDetails
Where NAME = '$(vName1)' and MonthYear = 'MAR 2016';

Concatenate (Data)

LOAD DISTINCT

                      EmpDetails,EMPID,

                     EMPLOYEE,EMPID,

                     COUNTRY,

                     [COUNTRY ID]
Resident EmpDetails

Where NAME = '$(vName2)' and MonthYear = 'APR 2016';


Drop field Junk;

Anonymous
Not applicable
Author

Thanks  sunny for pointing me to right answer

Binary ;

for each vTable_Field in 'EmpDetails,EMPID','EMPLOYEE,EMPID', 'COUNTRY,[COUNTRY ID]'
let vTable = subfield(vTable_Field,',',1);
let vField = subfield(vTable_Field,',',2);

INNER JOIN ($(vTable))
LOAD DISTINCT $(vField)
Resident EmpDetails
Where NAME = '$(vName1)' and MonthYear = 'MAR 2016';
Concatenate
LOAD DISTINCT $(vField)
Resident EmpDetails
Where NAME = '$(vName2)' and MonthYear = 'APR 2016';
next vTable_Field

Regards

Neetha

sunny_talwar

Not a problem at all

Anonymous
Not applicable
Author

Hi Sunny,

please need help.

I have an issue here ,its not concatenating data for user 2 properly.

thanks for any help

Regards

Neetha

sunny_talwar

Can you provide details?

Anonymous
Not applicable
Author

The below script is not loaded properly:

if I load other way round, user 1 data is not loaded ,could be issue with top part is getting loaded and inner joined and model is reduced and the issue

LOAD DISTINCT $(vField)
Resident EmpDetails
Where NAME = '$(vName2)' and MonthYear = 'APR 2016';
next vTable_Field