Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
msmichael
Contributor

need help on converting a date variable to integer

Hi experts,

I have a variable that is bound to a calendar, the variable now has name as vCOB_DATE and value is 43465 (Dec 31st, 2018).

I have a field call COB_DATE which has Interger type (Not Date or TimeStamp types), so values in this field are like below:

COB_DATE

20180131

20180228

...

20181231

I need to convert the variable into the integer "20181231" and use it in a set expression as a filter, but I tried below seems it does not work..

{<[COB_DATE]={"=$(num#(date(vCOB_DATE, 'YYYYMMDD')))"}

Could you please help?

Thanks!

 

Labels (2)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: need help on converting a date variable to integer

You are close. You just have the = in the wrong place. 

{<[COB_DATE]={"$(=num#(date(vCOB_DATE, 'YYYYMMDD')))"}

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

2 Replies
MVP & Luminary
MVP & Luminary

Re: need help on converting a date variable to integer

You are close. You just have the = in the wrong place. 

{<[COB_DATE]={"$(=num#(date(vCOB_DATE, 'YYYYMMDD')))"}

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

msmichael
Contributor

Re: need help on converting a date variable to integer

Thank you Rob!