Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Anonymous
Not applicable
Author

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')

Anonymous
Not applicable
Author

Hello

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

Anonymous
Not applicable
Author

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