Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello experts,
I've been trying several ways to deal with this but haven't hit spot. I want to show in a bar chart the last 30 dates for sales, no the last 30 days; and if I select a random date, it should show the last 30 dates from there.
So I've tried COUNT({< DATE={">=$(=max(DATE, 30))<=$(=max(DATE))"}>}salesID). It works without any selections, but when a date is selected it shows only the selection. I want the last 30 dates available from that selection.
Thanks and Happy Holidays!
By using max(DATE, 30) you get the 30th largest DATE value. It is not 30 days from Max(Date). Consider using max(DATE)-30.
Regarding you trouble when selecting.
Consider this data model.
If you use SET analysis on DATE, but make selections on Date, Day, Year or Month you wlll only get the part of the SET that also is included in your selections. To avoid this you should try to cancel these selections in you set.
COUNT({< DATE={">=$(=max(DATE)-30)<=$(=max(DATE))"}, Year, Month, Date, Day>}salesID)
I hope these two tips will help you to solve your problem.
Happy holidays!
Vegar
hi,
try this,
count({<date={">=$(=Date(AddMonths(max(date),-1)))<=$(=Date(max(date)))"}>}sales) //period 30 days
Hello Vegar,
Thanks for your response, but it didn't work out. If I insert the other calendar dimensions it doesn't help when selecting a date. For example, if I select 2019-12-10, I want to show that selection and the previous 30 dates, but it only shows the sole selection.
I've also tried limiting the dimension to the top 30 results, but it shows the 30 largest SalesID count, which is wrong. You know if there's a way to change that criteria to show the top 30 dates instead of the top 30 salesID count?
Cheers!
Its hard to help without having a common data sample to talk about. Please inspect, commant and maybe adjust my sample datamodel to fit your scenario.
If you do we might be able to help you.
BR
Vegar