Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
kangaroomac
Partner - Creator II
Partner - Creator II

QlikView Dates

Good Day,

I am trying to get a maximum date in a variable. I have created a date, using date# and makedate in the script. The date displays correctly in a listbox.

When using a text box I use the following expression: =Date(Max(Floor(myDate)), 'DD/MM/YYYY') - It Displays correct.

When I use the same expression when creating a variable though, I get 0.00002485....

Does anyone please have any Ideas why?

4 Replies
Anonymous
Not applicable

Could it be that your variable actually evaluates the date mathematically..

27/11/2012 could potentially be 27, divided by 11, divided by 2012.

I think it has something to do with how you've defined or are calling your variable.

Not applicable

this code ll load the max date value in script variable

date1:

LOAD date(date#(ChangeDateID,'YYYYMMDD'),'DD/MM/YYYY') as ChangeDateID,

     ChangeDateID as de,

     (MonthID) as MonthID ,

     date(date#(StockDateID,'YYYYMMDD'),'DD/MM/YYYY') as StockDateID

FROM

(ooxml, embedded labels, table is TB02_20120823_120900);

table:

LOAD max(ChangeDateID) as maxdate,

     RowNo() as r

     Resident date1;

    

let vardate=date(Peek('maxdate',0,'table'));

drop Table table;

date.JPG

kangaroomac
Partner - Creator II
Partner - Creator II
Author

Thank you everyone for your reply. I have tried all the above, but unfortunately to no avail. I have uploaded a "quick and dirty" example of what I mean.

The day devided by month sounds logical - but does not calculate to the same number when I manually devide them with a calculator.

Using the peek function to get the max gives me a differnt (8.25.... outcome) instead of the desired date.

Anonymous
Not applicable

My calculator gets the divided value I mentioned before.

Solution is to quote the variable when referencing it. Change your text object to this:

='vMaxDate:' & chr(10) & '$(vMaxDate)'