Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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:
Workaround:
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.
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:
Workaround:
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.
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'));
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
Thanks @Ruggero_Piccoli for your testing.