Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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



Tags (1)
1 Solution

Accepted Solutions
francescopuppin
New Contributor III

Re: Current Year using Select Field Action with Search string?

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.

4 Replies
francescopuppin
New Contributor III

Re: Current Year using Select Field Action with Search string?

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.

MVP
MVP

Re: Current Year using Select Field Action with Search string?

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

Re: Current Year using Select Field Action with Search string?

Thank you Francesco this worked very well.

Not applicable

Re: Current Year using Select Field Action with Search string?

Stefan,

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

Community Browser