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

Current Year using Select Field Action with Search string?

Hi,

I haven't seen anything that works in my scenario below.

I have a button that suppose to dynamically select the current year. Currently its hard coded as *2012* with wild cards which is the only thing that works..

I would like to use something like this:  Year(Today())

But nothing happens. I'm sure my syntax incorrect.

2013-01-15_113521.png

2013-01-15_113801.png



1 Solution

Accepted Solutions
francescopuppin
Partner - Contributor III
Partner - Contributor III

Hi Brian,

in my opinion the cleanest solution is to

1) add a field in the script

Year(ModEffDate) AS ModEffYear

2) Change your Action: Select in Field: ModEffYear. the search string is OK

This will solve your problem.

In alternative probably it can be done without adding that field... but let's be honest: it is always nice to have the Year field!

F.

View solution in original post

4 Replies
francescopuppin
Partner - Contributor III
Partner - Contributor III

Hi Brian,

in my opinion the cleanest solution is to

1) add a field in the script

Year(ModEffDate) AS ModEffYear

2) Change your Action: Select in Field: ModEffYear. the search string is OK

This will solve your problem.

In alternative probably it can be done without adding that field... but let's be honest: it is always nice to have the Year field!

F.

swuehl
MVP
MVP

Yes, introducing a Year field in the data model should make it work.

Alternatively, one can use a search string like

='=year(ModEffDate)=year(today())'

Regards,

Stefan

Not applicable
Author

Thank you Francesco this worked very well.

Not applicable
Author

Stefan,

This looks good too. I wish I could mark both correct. I can see the logic in the string work around. very helpful.