Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

ahmed_wael
New Contributor

Button to filter years from specific field

Hello,

I am creating a button reading from a database field that contains (01/2017, 02/2017,.... 01/2018,....)

I need this button called "2017" to just display the selections of 2017 alone and another button for the year of 2018.

I used the following in actions yet still not working:

=year()

another search string that i used:

=Timestamp(logdate,'format')

Any idea what could be done here to filter the selections of my graphs by just the year ?

3 Replies
alakshmanan
New Contributor III

Re: Button to filter years from specific field

Hi Ahmed,

Assuming the 'logdate' column contains values "01/2017", "02/2017", ....

try using this expression in your filter: mid(logdate, 4). This is like a substring function which in your case populates "2017", "2018", etc.



If you want one button for each year:

To create a "2017" filter, use this expression: if(mid(logdate, 4) = '2017', '2017')

Similarly, for a "2018" filter: if(mid(logdate, 4) = '2018', '2018')

ahmed_wael
New Contributor

Re: Button to filter years from specific field

Hello

Tried this but the button is not taking any action or reflecting in the graphs.

srobertson
New Contributor

Re: Button to filter years from specific field

What object are you using to create the button.  Is it the "Variables" custom extension by any chance?

Community Browser