Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to create a button - when I click the button it should select last 3 months data.
I suggest you to define a field in the same table of your date field as first day of the month:
MakeDate(my_year, my_month, 1) as YYYYMM01
or
MakeDate(year(my_date), month(my_date), 1) as YYYYMM01
Then define in variables view a variable that lists the last 3 months in date format:
varLast3Months = '(' &date(AddMonths(monthstart(today()),-3)) & '|' & date(AddMonths(monthstart(today()),-2)) & '|' & date(AddMonths(monthstart(today()),-1)) & ')'
Finally create your button with an action on selection in the field indicating your new data field (YYYYMM01) as field and =varLast3Months as search string.
Hope it helps.
Max
I suggest you to define a field in the same table of your date field as first day of the month:
MakeDate(my_year, my_month, 1) as YYYYMM01
or
MakeDate(year(my_date), month(my_date), 1) as YYYYMM01
Then define in variables view a variable that lists the last 3 months in date format:
varLast3Months = '(' &date(AddMonths(monthstart(today()),-3)) & '|' & date(AddMonths(monthstart(today()),-2)) & '|' & date(AddMonths(monthstart(today()),-1)) & ')'
Finally create your button with an action on selection in the field indicating your new data field (YYYYMM01) as field and =varLast3Months as search string.
Hope it helps.
Max
Check this out: Dynamically Selecting Timeframes
Hi Rosso, Terrific result. It is working perfectly...
Need a small favour. The below is to bring up the 1st date of month. How to change this to bring up for weeks?
MakeDate(year(my_date), month(my_date), 1) as YYYYMM01
I'm not sure to understand what result you want to reach. Could LunarweekStart() function help you in doining it?
Do you want to list all weeks of your month or, starting from my_date, you need to find the date when that week starts?
I figured the solution... Thanks for your prompt reply.
Great...
Hi, Viyay I need the last Week too, Could you pls put your solution.
Appreciate that,
Thanks!