最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

qlik expression - Filtering Qliksense dates by using buttons - Stack Overflow

programmeradmin10浏览0评论

I need to create a way to quickly filter dates 1 year before now, 6 months before now, 1 month before now, 1 week before now, etc. Buttons looks to be the best option. Looked into Date Picker, but to select the range manually takes too long and had some other issues. I created a button and tested it with "Select values matching search criteria" and "Select values in a field" actions. It worked with both actions when value was "='2024-09-23 00:00:00.000000'", worked with "Select value in a field" when value was "='2024-09-23'". Then tried a value suggested by chatGPT "='>=' & Date(AddMonths(Today(), -6))". None of the actions worked. Tried similar things like "='>=2024-01-01'", "='>2024-01-01'", etc, but nothing worked. For me it looks that value field has to have all the values I want to select, but I could not find a way to create a list of dates for the past 6 months dinamically. I was thinking about setting variables as well. What could I do in this situation?

I need to create a way to quickly filter dates 1 year before now, 6 months before now, 1 month before now, 1 week before now, etc. Buttons looks to be the best option. Looked into Date Picker, but to select the range manually takes too long and had some other issues. I created a button and tested it with "Select values matching search criteria" and "Select values in a field" actions. It worked with both actions when value was "='2024-09-23 00:00:00.000000'", worked with "Select value in a field" when value was "='2024-09-23'". Then tried a value suggested by chatGPT "='>=' & Date(AddMonths(Today(), -6))". None of the actions worked. Tried similar things like "='>=2024-01-01'", "='>2024-01-01'", etc, but nothing worked. For me it looks that value field has to have all the values I want to select, but I could not find a way to create a list of dates for the past 6 months dinamically. I was thinking about setting variables as well. What could I do in this situation?

Share Improve this question asked Feb 5 at 8:38 Laurynas GLaurynas G 60710 silver badges33 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I think you need to give the format of the date as well. In my case the date field is in format YYYY-MM-DD so my button expression is:

='<=' & Date(AddMonths(Today(),-6) ,'YYYY-MM-DD')

And this works ok with Select values matching search criteria action.

发布评论

评论列表(0)

  1. 暂无评论