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: 
mpressey
Creator
Creator

Formatting Variable Label in NP Pixel Perfect Report Not Working

I'm having trouble formatting a variable label in a NP pixel perfect report. Applying formatting just results in the format text string. Also the variable is formatted as a string in QlikView, but is being read as a number in NP. If this was not occurring, I would not have to try formatting the label in NP.

mpressey_0-1634059975387.png

 

 

Qlik NPrinting Feb 2021 SR1, QlikView Apr 2020 SR4

 

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, Can you share how is that variable created in QlikView? Is this value created in script or expression which calculates each time selection state changes? If it is expression how does it look like? I suspect it is using DATE() function in it.

Regardles of that based on my tests it seems like date format on variables simply does not work. I created 3 variables as per below:

Lech_Miszkiewicz_0-1634073956379.png

 

and the result when applied formatting {0:dd/MM/yyyy}:

Lech_Miszkiewicz_5-1634075888811.png

 

Lech_Miszkiewicz_1-1634074025298.png

So I thought that NPrinting will only recognize dates if they are using local regional settings of the machine which engine runs on, but my attepmt was also unsuccessful. I wanted the date in the middle to have YYYY-MM-DD format but it still kept just a text format from QlikView variable.

Lech_Miszkiewicz_2-1634074662513.png

Lech_Miszkiewicz_3-1634074935797.png

 

My conclusion:

  • I think that the date formatting feature does not work really in PixelPerfect with variables - what are your tests @Ruggero_Piccoli ?

Workaround:

  • Enforcing text() on variables in QlikView forces value to appear in format set in QlikView - see date_2 variable in my screenshots above
  • The same can be done directly in NPrinting by using nprinting formula 
  • Lech_Miszkiewicz_4-1634075574237.png

     

 

Anyway - I have tried various different options and none of the above worked. That was with NPrinting May 2021 SR2 and QlikView April 2020 SR3. Then I also updated QlikView to May 2021 SR1 and run the same tests once again without success. i don't know what else we can do in this case. I would just say that "Format string" is usless if variable needs to be formated as date. Numerical formats worked ok, but not dates. 

 

 

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, Can you share how is that variable created in QlikView? Is this value created in script or expression which calculates each time selection state changes? If it is expression how does it look like? I suspect it is using DATE() function in it.

Regardles of that based on my tests it seems like date format on variables simply does not work. I created 3 variables as per below:

Lech_Miszkiewicz_0-1634073956379.png

 

and the result when applied formatting {0:dd/MM/yyyy}:

Lech_Miszkiewicz_5-1634075888811.png

 

Lech_Miszkiewicz_1-1634074025298.png

So I thought that NPrinting will only recognize dates if they are using local regional settings of the machine which engine runs on, but my attepmt was also unsuccessful. I wanted the date in the middle to have YYYY-MM-DD format but it still kept just a text format from QlikView variable.

Lech_Miszkiewicz_2-1634074662513.png

Lech_Miszkiewicz_3-1634074935797.png

 

My conclusion:

  • I think that the date formatting feature does not work really in PixelPerfect with variables - what are your tests @Ruggero_Piccoli ?

Workaround:

  • Enforcing text() on variables in QlikView forces value to appear in format set in QlikView - see date_2 variable in my screenshots above
  • The same can be done directly in NPrinting by using nprinting formula 
  • Lech_Miszkiewicz_4-1634075574237.png

     

 

Anyway - I have tried various different options and none of the above worked. That was with NPrinting May 2021 SR2 and QlikView April 2020 SR3. Then I also updated QlikView to May 2021 SR1 and run the same tests once again without success. i don't know what else we can do in this case. I would just say that "Format string" is usless if variable needs to be formated as date. Numerical formats worked ok, but not dates. 

 

 

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.
mpressey
Creator
Creator
Author

The variable is being created in the load script. Anyway, adding text() around the QV script worked. I'll try it with the NP formula as well. Thank you for your help.

Let vCurrentDate = text(date(Today()-1,'MM/DD/YYYY'));

mpressey_0-1634079436853.png

 

 

Ruggero_Piccoli
Support
Support

Hi,

I did some tests similar to the ones of @Lech_Miszkiewicz and I confirm that the format applied on the label object is not working in both cases Variables and Formulas. You have to use Text() and apply the format on Qlik side.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Thanks @Ruggero_Piccoli for your testing. 

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.