Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to truncate date list box at today's date

Hi,

I have a list box in my sheet for date (MM/DD/YYYY). Selecting dates on this box slices the model.

I have the dates there sorted in descending order, and the problem is I see future dates there on top. I have records with dates all the way up to 2016 and that's of no use for me...

How do I get the list box to show dates only up to current day? (that is, not today, April 10th, but the day the sheet is accessed).

Thank you!

Al

20 Replies
MK_QSL
MVP
MVP

You need to check Today() function....

today([timer_mode] )

Returns the current date from the system clock. The timer_mode may have the following values:

0 Date at script run
1 Date at function call
2 Date when the document was opened  

Not applicable
Author

how should i check it?

I created a text object with

=today([timer_mode] )

and it shows today's date

MK_QSL
MVP
MVP

Try

Today()

Only..

Load you qvw file by removing all fields except the Date..

Not applicable
Author

today() only yields 8/4/14

why is that?

MK_QSL
MVP
MVP

If your file is on server, restart the server...

Or

Close the qlikview apps and reopen the file...

Roop
Specialist
Specialist

How about scripting your date so that it automatically generates the date up to today:

Let vDateFormat = 'DD-MMM-YYYY';

DateDim:

Load

     Date((today() - RowNo()) + 1, '$vDateFormat') as Date

autogenerate (3000);

Not applicable
Author

hmm... I closed and re-opened Qlikview and got this scary messageinconsistency.PNG.png

Roop
Specialist
Specialist

Always a scary message - sometimes corruption and sometimes you are OK. You just have to hope!

Not applicable
Author

does it have anything to do with the new list box with expression I added?

Roop
Specialist
Specialist

Unlikely