Hi @ward.brand ,
I don't think this is possible with a button but you can do it with an OLAP table.
You can use this PQL as dimension:
CASE WHEN DAYS_BETWEEN ("CASE_TABLE"."created", TODAY()) < 8 THEN 'Last 7 Days' ELSE 'Older than 7 Days' END
For the KPI just use a normal case count.
Then you can filter on the Last 7 Days.
Similarly you can create the same for the calendar week.
Let me know if this works! :)
Hi @ward.brand ,
I don't think this is possible with a button but you can do it with an OLAP table.
You can use this PQL as dimension:
CASE WHEN DAYS_BETWEEN ("CASE_TABLE"."created", TODAY()) < 8 THEN 'Last 7 Days' ELSE 'Older than 7 Days' END
For the KPI just use a normal case count.
Then you can filter on the Last 7 Days.
Similarly you can create the same for the calendar week.
Let me know if this works! :)
Hi @1460067637 ,
Thanks for your reply! The workaround with the OLAP-table works. It's unfortunate that it's not possible with a button though... Thanks for your help!
Kind regards, Ward
Hi Ward, to add to what my colleague mentioned above: it is possible with a workaround. We discussed it and came up with the following solution/workaround to actually be able to use buttons:
- Create a variable (test/replacement type): I will refer to it as "sheet_filter1"
- Create 3 buttons: (1) "Last 7 days", (2) "Last full week", (3) "Reset"

- Now we will add the PQL filter statements to the buttons. Therefore, we open each button 1 by 1, select the button action "set variable", select the variable "sheet_filter1", and copy and paste the PQL Filter below
- Button "Last 7 days": FILTER "TABLE"."DATE_TIME" >= ADD_DAYS(TODAY(), -7);
- Button "Last full week": FILTER "TABLE"."DATE_TIME" BETWEEN ROUND_WEEK(ADD_DAYS(TODAY(), -7)) AND ROUND_WEEK(TODAY());
- Button "Reset": ;
- Example screenshot for the "Last full week" button:

- The last step is to add the variable "sheet_filter1" via the setting to the sheet filter with the "load script" option:

Now you are good to go.
If you have any other questions, feel free to ask Lorenco or me! 😊
Hi Ward, to add to what my colleague mentioned above: it is possible with a workaround. We discussed it and came up with the following solution/workaround to actually be able to use buttons:
- Create a variable (test/replacement type): I will refer to it as "sheet_filter1"
- Create 3 buttons: (1) "Last 7 days", (2) "Last full week", (3) "Reset"

- Now we will add the PQL filter statements to the buttons. Therefore, we open each button 1 by 1, select the button action "set variable", select the variable "sheet_filter1", and copy and paste the PQL Filter below
- Button "Last 7 days": FILTER "TABLE"."DATE_TIME" >= ADD_DAYS(TODAY(), -7);
- Button "Last full week": FILTER "TABLE"."DATE_TIME" BETWEEN ROUND_WEEK(ADD_DAYS(TODAY(), -7)) AND ROUND_WEEK(TODAY());
- Button "Reset": ;
- Example screenshot for the "Last full week" button:

- The last step is to add the variable "sheet_filter1" via the setting to the sheet filter with the "load script" option:

Now you are good to go.
If you have any other questions, feel free to ask Lorenco or me! 😊
This is exactly what I was looking for, thank you both so much! @1460017979 @1460067637