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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator III
Creator III

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.

18 Replies
surajap123
Creator III
Creator III
Author

Hi Max,

Thanks !!

When i run the reload, the expression still changes to integer value for the variable vECBMaxDate..

Anonymous
Not applicable

It works this way because this variable is defined in the script, hence you get it after each reload.  Yes, it is defined as a number:

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

Greg_Williams
Former Employee
Former Employee

Have you tried floor("date field") to strip the time?

Perhaps =date(date#("date field"),'MM-DD-YYYY')?

Verify the format for the field is not set to Integer in your chart properties > Number tab.

-Greg

PrashantSangle

Hi,

Now checked Enclosed File.

Even after reloading the format is not changing.

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 🙂
Anonymous
Not applicable

That is, if you remove this line in the script, you can define it in the Variables overview any way you want, and it will not be overwritten anymore.

surajap123
Creator III
Creator III
Author

Hi Michael,

I am not sure where to use your expression in the app.

The issue is, the variable vECBMaxDate is used in my charts and, whenever i reload, all my charts using the variable shows zero as values.

Please have a look at the app and souce data, i have attached in the previous message.

Anonymous
Not applicable

There is nothing to use in the app - just remove or comment line 14 on the tab Calendar in the script.

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

surajap123
Creator III
Creator III
Author

Thanks everyone for your time..