Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
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: 
Not applicable

Excel Sheets with Same column names

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.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

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)


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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)


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thank you. It works like a charm. I really appreciate for your reply. Thanks again.