Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sevvalk
Creator
Creator

Hi I want to get before 15 days today with button.

Hi I want to get before 15 days today with button. İf today is 30.01.2024, I want to get dates after 15.01.2024. How can i do that with button.

1 Solution

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

  1. Create a variable to store the state of the button. I named it vShowLast15Days.
  2. Create a button. Select "Set variable value" as the action. Select the new variable and use "not vShowLast15Days" as the expression.
    LRuCelver_0-1707208559356.png
    You can use the variable in an if statement to change the way the button looks in either state.
  3. In your table create a column for the dates using this expression:
    If(not vShowLast15Days or Date > Today() - 15, Date)
    Make sure to disable the "Include null values" checkbox.
    LRuCelver_3-1707208924385.png

Clicking the button now toggles whether all or only the last 15 days until today are shown:

LRuCelver_1-1707208793135.png

LRuCelver_2-1707208817917.png

 

View solution in original post

4 Replies
LRuCelver
Partner - Creator III
Partner - Creator III

How/where do you want the dates? As a dimension in a table? Concatenated to a text?

What is supposed to be shown when the button is not pressed/toggled? Should all dates be shown?

sevvalk
Creator
Creator
Author

When I click the button, Button should choose the days.

LRuCelver
Partner - Creator III
Partner - Creator III

  1. Create a variable to store the state of the button. I named it vShowLast15Days.
  2. Create a button. Select "Set variable value" as the action. Select the new variable and use "not vShowLast15Days" as the expression.
    LRuCelver_0-1707208559356.png
    You can use the variable in an if statement to change the way the button looks in either state.
  3. In your table create a column for the dates using this expression:
    If(not vShowLast15Days or Date > Today() - 15, Date)
    Make sure to disable the "Include null values" checkbox.
    LRuCelver_3-1707208924385.png

Clicking the button now toggles whether all or only the last 15 days until today are shown:

LRuCelver_1-1707208793135.png

LRuCelver_2-1707208817917.png

 

jochem_zw
Employee
Employee

see the post from @LRuCelver