Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm new to QlikView and I've got a problem.
I want to import data from Excel file. The file has 2 different sheets with exact same column names.
All column names are same in both sheets.
Questions :
How can I load two sheets in "Edit Script"? (I know file name and names of sheets)
How can I read different data from columns with same names?
I want to compare these two sheets' data.
Please any suggestions? Thank you.
Load your data like this:
Data:
LOAD ID,
Name,
Amount,
'Sheet1' As Source
FROM test.xlsx
(ooxml, embedded labels, table is Sheet1);
Concatenate(Data)
LOAD ID,
Name,
Amount,
'Sheet2' As Source
FROM test.xlsx
(ooxml, embedded labels, table is Sheet2);
Then you can compare the two sheets. For example, in a straight table with ID and Name as dimensions, use these two expressions to compare the amounts:
=Sum({<Source = {'Sheet1'}>} Amount)
=Sum({<Source = {'Sheet2'}>} Amount)
and these two to compare row counts:
=Count({<Source = {'Sheet1'}>} Amount)
=Count({<Source = {'Sheet2'}>} Amount)
Load your data like this:
Data:
LOAD ID,
Name,
Amount,
'Sheet1' As Source
FROM test.xlsx
(ooxml, embedded labels, table is Sheet1);
Concatenate(Data)
LOAD ID,
Name,
Amount,
'Sheet2' As Source
FROM test.xlsx
(ooxml, embedded labels, table is Sheet2);
Then you can compare the two sheets. For example, in a straight table with ID and Name as dimensions, use these two expressions to compare the amounts:
=Sum({<Source = {'Sheet1'}>} Amount)
=Sum({<Source = {'Sheet2'}>} Amount)
and these two to compare row counts:
=Count({<Source = {'Sheet1'}>} Amount)
=Count({<Source = {'Sheet2'}>} Amount)
Thank you. It works like a charm. I really appreciate for your reply. Thanks again.