Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a Business_Day field. If the user selects one date, I need the prior 30 days from the selected date as a dimension on a graph.
For example, if I select 10/01/2018
I would expect to see on my graph the dates between 09/01/2018 and 10/01/2018. Something like this:
I need it as a calculated dimension on my graph. Any ideas?
Add Business_Day as a dimension, don't use a calculated dimension. Then use Thirumala's expression as an expression, and replace the Date in both Max(Date) functions with your date field (Business_Day) (ONLY the 'Date' in the Max function, the other ones are functions). Next replace 'YourField' with the field you want summed in your chart. You can replace Sum with Count or whatever if necessary. If your expression is more complex than a simple sum or count, you'll have to post it and we'll see if we can help.
May be as below:
Expression:
Sum( {<Date={">=$(=Date((Max(Date)-30))) <=$(=Date(Max(Date))) "}>} YourField )
If I add that expression as a dimension I get an 'Error in Calculated Dimension' on my graph.
If you share a sample it will be easy to take a look...
Add Business_Day as a dimension, don't use a calculated dimension. Then use Thirumala's expression as an expression, and replace the Date in both Max(Date) functions with your date field (Business_Day) (ONLY the 'Date' in the Max function, the other ones are functions). Next replace 'YourField' with the field you want summed in your chart. You can replace Sum with Count or whatever if necessary. If your expression is more complex than a simple sum or count, you'll have to post it and we'll see if we can help.
Thank you Jens for your explanation. Now I get it. It is working fine.
Thank you both!