Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
renjithpl
Specialist
Specialist

Get excel sheet names as field value

Hi,

I found a solution from one of the link,  to load data from different excel sheets,

for each vSheet in 'Jan$', 'Feb$','Oct$'

MyTableName:

Load ........From (biff,embedded labels,table is $(vSheet));

next;

but is there any coding where i want to take Jan, Feb, Oct as one field name called MonthName.

so when i click on Jan only jan sheet data should populate, and so on..

thanks

1 Solution

Accepted Solutions
stevedark
MVP
MVP

You just need to add an extra line to the load script to put the variable out to a field:

MyTableName:

LOAD
     mid('$(vSheet)', 1, 3) as [Month Name],

     ....

From (biff,embedded labels,table is $(vSheet));

If you want the months to sort correctly you will need to add a bit more code:

     Month(Date#('01 ' & mid('$(vSheet)', 1, 3) & ' 2000', 'DD MMM YYYY')) as [Month]

This will convert the text to a full date, before converting it back to a month.

Hope that helps,

Steve

View solution in original post

2 Replies
RSvebeck
Specialist
Specialist

You can apply triggers on sheets in Qlikview. And the trigger can make a selection on a field of you choice. So if you click a sheet, it can filter the data that is shown on that sheet.

Best Regards, Robert

Svebeck Consulting AB
stevedark
MVP
MVP

You just need to add an extra line to the load script to put the variable out to a field:

MyTableName:

LOAD
     mid('$(vSheet)', 1, 3) as [Month Name],

     ....

From (biff,embedded labels,table is $(vSheet));

If you want the months to sort correctly you will need to add a bit more code:

     Month(Date#('01 ' & mid('$(vSheet)', 1, 3) & ' 2000', 'DD MMM YYYY')) as [Month]

This will convert the text to a full date, before converting it back to a month.

Hope that helps,

Steve