Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have a requirement where I want to show measure beginning on the 7th of the month. For example: if user select a date or don't select the date between 1st and 10th (it could be any month). I only want to show data anything after 7th of the month.
Somehow the below measure is not working.
Sum({<processing_date = {">=MonthStart(today())+6"}>} total_purchase + total_adjustment)
Thanks Ruben for your help. Really appreciate it.
Here is my final set analysis incase if someone runs into the same scenario.
if(GetSelectedCount(DateFieldName)=0,Sum({<DateFieldName= {">$(=date(Monthstart(Today())+6))"}>} Measurename), Sum({<DateFieldName= {">=$(=Date(MonthStart(Min(DateFieldName)+7,-1)))<$(=Date(MonthStart(Max(DateFieldName))))"}>} Measurename))
Hi, using today(), the reference date will be always the current date, not the selected date, also you should use $() to calculate the expression. And lastly the expression returned by the calculation has to be correctly interpreted, so better to use the DAte() function or to use a date field that is a number.
In example, if you want to use the max date selected as reference it could be:
Sum({<processing_date = {">=$(=Date(Max(DateFieldName)+6))"}>} total_purchase + total_adjustment)
Hi Ruben,
When I select a date the results are always for the next month. For example if I select April I am getting the data for May. Any idea why this is happening?
For the previous question requirement change so I was able to get it working using the below set analysis
Sum({<processing_date = {">$(=date(Monthstart(Today())+6))"}>} total_purchase + total_adjustment - total_refund)
I have another requirement what ever month user select I want to show previous month data. Please let me know how this can be achieve.
Hi, if you select just may the max date will be the 31st of may, and adding 6 days y goes to juny. You can try with Min instead of Max.
Sum({<processing_date = {">=$(=Date(MonthStart(Max(DateFieldName),-1)))<$(=Date(MonthStart(Max(DateFieldName))))"}>} total_purchase + total_adjustment)
Thanks Ruben for your help. Really appreciate it.
Here is my final set analysis incase if someone runs into the same scenario.
if(GetSelectedCount(DateFieldName)=0,Sum({<DateFieldName= {">$(=date(Monthstart(Today())+6))"}>} Measurename), Sum({<DateFieldName= {">=$(=Date(MonthStart(Min(DateFieldName)+7,-1)))<$(=Date(MonthStart(Max(DateFieldName))))"}>} Measurename))