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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nchamilton162
Contributor
Contributor

Date Formatting

Good morning,

I'm loading a start date variable and Qlik is interpreting it as a decimal. Why is it doing that? 

Variable: Let sdate = ‘01/01/2021’; 

Result: 

nchamilton162_0-1682512402033.png

I'm also having trouble converting an ascii, text to a date format. 
Here are a couple of my attempts at converting from ascii, text to a date. Both convert it to a numeric,integer

Date(Date#(FLAT_DTE_EFF),'MM/DD/YYYY') as new_date

nchamilton162_1-1682512722108.png

 

Date(Date#(FLAT_DTE_EFF,'MM/DD/YYYY'),'MM/DD/YYYY') as new_date1

nchamilton162_2-1682512739077.png

Objective:

I would like to use a rangemax(new_date,$(sdate)) but my end result is a decimal and I can't seem to convert that to a valid date.

 

Thanks

Labels (1)
1 Reply
marcus_sommer

Your call of: $(sdate) creates a division of 1 / 1 / 2021. To let Qlik it's interpreting as date the variable needs to be wrapped with single-quotes like: '$(sdate)'.

More simple would be to create the variable in this way:

let sdate = floor(makedate(2021));

and then you could call them again per $(sdate).