Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rsmithy
Contributor III
Contributor III

Date Variable Display

I have  "Let"  two date variables in the load script:
vMinOvertimeMonth    12/1/2020,   44166
vMaxOvertimeMonth   12/1/2021,   44531

To be sure they are really dates I check with these:
if(istext(vMinOvertimeMonth),'string','Date') returns Date
if(istext(vMaxOvertimeMonth),'string','Date') returns Date

The date format  is:  SET DateFormat='M/D/YYYY';

In a table the variables display as :

  • vMinOvertimeMonth     12/1/2020
  • vMaxOvertimeMonth     44531
  • =date(vMinOvertimeMonth,'YYYY-MMM-DD')      2020-Dec-01
  • =date(vMaxOvertimeMonth,'YYYY-MMM-DD')     2021-Dec-01
  • =$(vMinOvertimeMonth)     .0059
  • =$(vMaxOvertimeMonth)    44531

I am curious why the display is not consistent for the two variables.

 

Variables are created here:

MaxOvertimeMonth:
LOAD
max(DATE#(myDate,'MM/DD/YYYY')) as maxMnth
FROM [$(OVERTIME)] (qvd);
Let vMaxOvertimeMonth = peek('maxMnth',0,'MaxOvertimeMonth');
Let vMinOvertimeMonth = addyears(vMaxOvertimeMonth,-1);

Labels (2)
1 Reply
rsmithy
Contributor III
Contributor III
Author

It would be nice if there is a way to force QS to evaluate the date part (string or number) you want to be working with:

vMinOvertimeMonth.string()    or  vMinOvertimeMonth.num()