Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator II
Creator II

expression changes to integer value

Hi All,

Every time i reload the dashboard the variable(vMaxDate) containing expression =max(Date) is changing to integer number(41771), instead of Date value like 12/05/2014. This i can see in the input box.

I changed the expression from =max(Date) to =Date(max(Date)), but still the expession changes to integer number after reload.

1 Solution

Accepted Solutions
Anonymous
Not applicable

Correction:  You can not remove it because it is used further in the script.  But you can change it - replace num with date: 

Let  vECBMaxDate = date(Peek('maxDate', 0, 'Temp')); 


If you need it as num() in the script, use  num($(vECBMaxDate)


See attached

View solution in original post

18 Replies
anbu1984
Master III
Master III

Try this

Date(max(Date),'M/D/YYYY')

surajap123
Creator II
Creator II
Author

Hi Ambu,

I tired with your expression, but still the expression is changed to integer value 41771(ie todays date), after the reload

ashfaq_haseeb
Champion III
Champion III

Hi,

can you post a sample app.

May be you have different date format.

Date(max(Date),'M/D/YYYY')

Replace 'M/D/YYYY' with your date format.

Regards

ASHFAQ

anbu1984
Master III
Master III

Can you show your app?

surajap123
Creator II
Creator II
Author

Hi Ambu/Ashfaq,

I have checked the source table now, and i see that the date field value is 2014-05-12 09:51:40.807.

There is another date field in the dashboard for which the variable is working. This date field value is like 2009-03-07 00:00:00.000

So, having time stamp value like this (2014-05-12 09:51:40.807) is a problem?

How can i handle this?

Anonymous
Not applicable

To cut off the time part, you can use floor() function:

date(max(floor(Date)))

surajap123
Creator II
Creator II
Author

Hi Ambu / Ashfaq,

Please find the app and the source data.

PrashantSangle

Hi,

Check Enclosed File.

It is as per your requirements.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
surajap123
Creator II
Creator II
Author

Hi Michael,

Thanks for your reply !!

I have tried with the expression you provided. But still the expression changes to integer value for the vECBMaxDate variable.

Please find the app and source date i have attached in my earlier message. Kindly help !!