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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pulling a text string based on the date

Hi all,

I have a table in my load script that has text strings associated with each date in the year. For example:

Column 1               Column 2
date_activity          quote
01/01/2012            "Four score and seven years ago..."

01/02/2012            "We have nothing to fear..."

The idea I'm trying to accomplish is to display, in a Text Box, the quote associated with Today's Date. If I use the expression:

maxstring(quote)

I get the quote associated with the last day of the filtered time period. I don't want the quote and expression to be altered by any filters; I always want the Text Box to display Today's quote based on Today's date. Ideas?

Thank you very much, in advance, for your help!

Stephen

6 Replies
Anonymous
Not applicable
Author

Stephen,

Try something like this:
=only({<date_activity={"$=(date(today()))"}>} quote)

Regards,
Michael

Not applicable
Author

Hi Michael,

I think you're on the right track. Our "date" fields are a bit odd here, but I think if I play around with your expression above long enough, I'll get there. Thanks!!

Not applicable
Author

If maxstring(quote) was working for you except for selections, try adding set to it:

maxstring({1} quote)

this should ignore all selections

Not applicable
Author

Hi Marc,

That formula returns the last “quote” in my list; I want the expression to give me the “quote” associated with Today. Good idea though!

Stephen

Anonymous
Not applicable
Author

Combining both, and adding date format:

=only({1<date_activity={"$=(date(today(),'MM/DD/YYYY'))"}>} quote)

The set expression are especially "format-sensitive".  I'm showing it here only as example, understanding that it could be quite different in your situation.

Regards,

Michael

jagan
Partner - Champion III
Partner - Champion III

Hi,

Hope attached file helps you.

Regards,

Jagan.