Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
leoamul_raj
Contributor
Contributor

Qliview - Query - Consolidation of binary files

Dear all,

 

please let me know why i am unable to get the output.

I need to check  values when the loop i and j runs but the code runs successfully without any output.

table 'Filedata' is not created.

LET i =0;

LET j=0;

Uname:
LOAD Unit_Name
FROM
[E:\Binary_Test\Unit.xlsx]
(ooxml, embedded labels, table is Sheet1);



//Loop Through Files in FOlder

FOR EACH file in FileList('E:\Binary_Test\*.xlsb');

ODBC CONNECT64 TO [Excel Files;DBQ=$(file)];

xlsbtables:
SQLtables;

DISCONNECT;

FOR i = 0 to NoOfRows('xlsbtables')-1
FOR j = 0 to NoOfRows('Uname')-1

          
          Filedata:
          Load     
          PURGECHAR(PURGECHAR(PEEK('TABLE_NAME', i, 'xlsbtables'), CHR(39)), CHR(36)) as sname,
          PEEK('Unit_Name', j, 'Uname') as uname
          ;
NEXT j;
NEXT i;
Next;

 

3 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @leoamul_raj, your Load statement for Filedata needs an origin of rows to load (like the FROM clause in SQL). From where are you trying to load the sname and uname fields?

In case the two values are constants, you can use the following syntax:

Filedata:
Load     
   PURGECHAR(PURGECHAR(PEEK('TABLE_NAME', i, 'xlsbtables'), CHR(39)), CHR(36)) as sname,
   PEEK('Unit_Name', j, 'Uname') as uname
Autogenerate(1)
;

JG

leoamul_raj
Contributor
Contributor
Author

Thank you for the  reply.

I need to consolidate  the xlsb files based on the another file.

I have attached the files to consolidate(concatenate)  'alain.xlsb' and 'ajman.xlsb' based on the sheet names in 'unit.xlsx'

thanks,

leo

 

leoamul_raj
Contributor
Contributor
Author

Dear Team,

I did not get any reply.

Regards,

Leo