
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Qlik NPrinting Feb 2021 SR1, QlikView Apr 2020 SR4
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
and the result when applied formatting {0:dd/MM/yyyy}:
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.
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
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
and the result when applied formatting {0:dd/MM/yyyy}:
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.
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
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'));


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Ruggero_Piccoli for your testing.
