Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
profilejamesbond

NPrinting - Dynamic Sheet Name

Hi,

I want to assign a dynamic name to the NPrinting Sheet Name but somehow it is not working. I followed these steps but still not working:

Step 1: I created a variable in the QlikView -> vMaxWeekName =MonthName(Max(DATE)) & '_' & KW01

Step 2: Added variable "vMaxWeekName" in NPrinting Variable section

Step 3: Drag and Dropped this variable vMaxWeekName in NPrinting Sheet Title. But see static output as it is variable name: 

profilejamesbond_0-1680001890406.png

 

I tried these 2 solutions but are not working for me:

1. @Lech_Miszkiewicz 

https://community.qlik.com/t5/Qlik-NPrinting/Formula-in-Excel-Sheet-Names/td-p/1607621

 

2. @avinashelite

https://community.qlik.com/t5/Qlik-NPrinting/renaming-lt-NPrinting-Sheet-Label-Page-gt/m-p/967793#M6...

 

 

Labels (3)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @profilejamesbond 

Mine example is the only one which can give you dynamic sheet name. It is not based on variables or formulas but it must be based on <Page> tag and field value. 

My explanation in link provided is very thorough so I am not sure which part is not working for you?

As per analogy you would need to create a field in your data model which would store that single value of MAX Week Name as a field value and then just use it as a page in excel template

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

4 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @profilejamesbond 

Mine example is the only one which can give you dynamic sheet name. It is not based on variables or formulas but it must be based on <Page> tag and field value. 

My explanation in link provided is very thorough so I am not sure which part is not working for you?

As per analogy you would need to create a field in your data model which would store that single value of MAX Week Name as a field value and then just use it as a page in excel template

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Aditya_Chitale
Specialist
Specialist

@profilejamesbond ,

1. Create variables in script containing the expression for dynamic sheet names.

2. Add those variables in a inline table and use the inline table fields in frontend table chart.

let vName=<your expression for dynamic naming>;

dynamicsheetName:
load * inline
[
SheetName
$(vName)
];

3. Now as posted by @Lech_Miszkiewicz  add the qliksense object in 'Page' option in Nprinting template and a sheet will be automatically get created having the same name as your qliksense chart column value.

 

Regards,

Aditya

profilejamesbond
Author

Hi @Lech_Miszkiewicz,

I see the variable is not working but with page it is working.

I want to ask you last thing, how to handle multipe sheet names.

Do I need to create multiple fields in Data Island for each sheet name or anyother way?

 

For example:

1. I have one report in excel file format and it has two tabs:

1st tab name is 'Text' & Calender Week

2nd tab name 'Text' & This Year

 

 

2. I have another report in excel file format and it has also two tabs:

1st tab name is 'Text' & Calender Week

2nd tab name 'Text' & Last Year

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

It depend what those Sheets in Excel represent.

If each of those sheets contains different layout of the report then yes - you need to create individual independent fields. My solution is just a workaround as <Page> has normally completely different use - see https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/ExcelReports/Create-Excel-Reports.ht... 

However if your Week and Year Sheets are exactly the same and only time frame is different which has to be applied then maybe you could leverage <Page> and use single field with grouping dimension which will support both reports.

I suggest you study thoroughly the help document for more info.

cheers 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.