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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get exccel Sheet Names

Hello, I have an excel and i whant to verify that the 2 sheets exist.

 

How can i do that? i tried with Tmap and ((String)globalMap.get("tFileInputExcel_1_CURRENT_SHEET")) but i get multipe times the sheet names. See pic.

Labels (3)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Hi,

As far as I know there is no shortcut for this purpose.

However, you can select "All sheets" on configuration tab, then connect tFileInputExcel to a tJava and set a global variable for each sheet (but remember the Excel must be read for that) using the following Java code:

globalMap.put((String)globalMap.get("tFileInputExcel_1_CURRENT_SHEET"), "");

After tJava, if you're expecting for 2 sheets named sheet1 and sheet2, you can use an If trigger to connect the next component with this condition: 

(String)globalMap.get("sheet1") != null && (String)globalMap.get("sheet2") != null

As soon as sheet1 and sheet are defined in the Excel file and are not empty, the condition is true and je job continue with the next component.

Hope this helps.

View solution in original post

2 Replies
TRF
Champion II
Champion II

Hi,

As far as I know there is no shortcut for this purpose.

However, you can select "All sheets" on configuration tab, then connect tFileInputExcel to a tJava and set a global variable for each sheet (but remember the Excel must be read for that) using the following Java code:

globalMap.put((String)globalMap.get("tFileInputExcel_1_CURRENT_SHEET"), "");

After tJava, if you're expecting for 2 sheets named sheet1 and sheet2, you can use an If trigger to connect the next component with this condition: 

(String)globalMap.get("sheet1") != null && (String)globalMap.get("sheet2") != null

As soon as sheet1 and sheet are defined in the Excel file and are not empty, the condition is true and je job continue with the next component.

Hope this helps.

fab_74
Contributor III
Contributor III

 hello

use taggregate after your tmap