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: 
AndersGS
Contributor III
Contributor III

Display Weekname in NPrinting file name

Hi,

I have a report scheduled Mondays that includes last weeks data. In the file name, I'd like to include the name of last week, i.e. for example "Weekly Sales Report 2019/38".

I have this variable set up in QlikView:

SET vWeekNameReport =weekname(today()-1) 

This variable is added to the report Dynamic name/Qlik variable

But the file displays the content of the variable rather than the week name: "Weekly Sales Report_weekname(today()-1)"

 

We are running NPrinting 19 February 2019 SR1 and QlikView 11.20 SR 18.


Thanks in advance

Regards,
Anders

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

this means that you are putting = sign in front of first variable and not the second variable

simply use one variable for this exercise and again - note the "=" sign which you did not have in front of your variable expression


SET vWeekName_LW    = "=Replace(Text(WeekName(Floor(ReloadTime())-1)),'/','-')";

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

9 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

This topic is very well documented with youtube tutorials and official documentation. Please read help to understand why you get a content of variable instead of actual evaluated value - link below.

 

https://help.qlik.com/en-US/nprinting/June2019/Content/NPrinting/ReportsDevelopment/Work-with-variab...

and also here

https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Using-Variables-in-the-Email-Subject/td-p/1...

also here

https://www.youtube.com/watch?v=3HFdrqsbQlk

 

you are missing the most important thing: "="(equal sign) in front of your variable so it can evaluate!!!

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.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Just to follow up - my examples show you how to use variable in message subject etc.. but princliple is the same as variable needs to be evaluated....

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.
AndersGS
Contributor III
Contributor III
Author

Thanks Lech! And thanks for the examples.

The = sign is present in the variable "=weekname(today()-1)" . I have tested using a simple date variable like
"= Date(Floor(Now()))" and it works. I'm thinking it's a problem with evaluating the WeekName syntax in my current variable (or MonthName/YearName)?

What do you think? 

AndersGS
Contributor III
Contributor III
Author

Could be the fact that WeekName returns 2019/38 which would  be a non supported file name. How could I amend the variable to change the "/" to a "-"?

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

How about replace($(variable),’/‘,’-‘)

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.
AndersGS
Contributor III
Contributor III
Author

Thanks. I created these two variables:

SET vWeekName_LW    = WeekName$(vReloadDate)-1;
SET vReport_LW             = replace($(vWeekName_LW),'/','-w');

but it still does not do the trick unfortunately:

Output pdf file name:  Weekly Report_replace(WeekName2019-09-24-1,'_','-w').pdf
what I want to see here is rather Weekly Report_2019-w39.pdf

any ideas?

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

this means that you are putting = sign in front of first variable and not the second variable

simply use one variable for this exercise and again - note the "=" sign which you did not have in front of your variable expression


SET vWeekName_LW    = "=Replace(Text(WeekName(Floor(ReloadTime())-1)),'/','-')";

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.
AndersGS
Contributor III
Contributor III
Author

Worked perfect, thanks Lech!

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

No worries mate!

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.