Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've month and date field in my application, now my requirement is if is select October as month in filters and 2022 in year filter it has to show last 12 month information in a bar chart, means from oct-2021 till sep-2022 as different bars and in the same way if is select June as month in filters and 2022 in year filter it has to show last 12 month information in a bar chart, means from Jun-2021 till may-2022 in different bars.
Regards,
Vikas
Try the following set expression in your bar chart:
{<Year=,Month=,Date={">$(=AddMonths(Max(Date),-12))<=$(=Date(Max(Date)))"}>}
thanks for that @hic and it working as I expected, in my app I've data from 2021 Jan until Dec 2022. If I select May from Month and 2022 from year I can able to pull the details from June 2021 until May 2022. If I Don't select anything any thing I see information from Jan 2022 till Dec 2022 but I would like to see information from Jan 2021 until current month (i.e. July 2022).
Try
{<Year=,Month=,Date={">$(=If(GetSelectedCount('Month')>0,MakeDate(1900),AddMonths(Max(Date),-12)))<=$(=Date(Max(Date)))"}>}
displaying same result, no change.
Try
{<Year=,Month=,Date={">$(=If(GetSelectedCount('Month')>0,AddMonths(Max(Date),-12)))<=$(=Date(Max(Date))),
Date(monthstart(today(),-12))<=$(=Date(monthstart(Today ()))
"}>}
Not working as well.
Can some one help me to achieve this.
@vikasshana , can you explain little bit more about not working?
In my solution, I suggest if nothing is select then it will show previous 12 months data. You can modify it as per your requirement. so for example you confirm with that if nothing is selected then it will show from Jan 2021 to till current month then you can modify else part as per your requirement like
Try
{<Year=,Month=,Date={">$(=If(GetSelectedCount('Month')>0,AddMonths(Max(Date),-12)))<=$(=Date(Max(Date))),
Date(Date#('1-1-2021','DD-MM-YYYY'))<=$(=Date(monthstart(Today ()))
Regards,
Prashant Sangle
"}>}