Happy New Year, everyone! I had a quick question a...
# gooddata-cloud
d
Happy New Year, everyone! I had a quick question about the dashboard level date filter. Currently, there isn't a way to get the date values from the date picker, is there? I have a metric that requires the number of months currently selected to get an accurate result. I don't think pre-computing every possible date range is a viable option for this either, so really I'd need to be able to extract the number of months currently selected in MAQL. Is this in anyway possible?
m
Hi Devin, Happy New Year to you! I am not sure I 100% get your question, but it is possible to define a “Static Period” with the desired date values. You could achieve similar results by selecting a “relative period”. If this is not what you are looking for, could you please elaborate?
d
The metric I am interested in determining requires being divided by the number of months in the current date window. So my metric looks like this: SUM(Monthly recurring revenue) / Number of months in date filter This gives the the accurate metric I want. Right now I just have this division hard coded to 3, as this dashboard will mostly be looked at a quarter at a time. But I would like to have this metric support any date range. If they looked at a whole year, it would divide by 12 instead of 3, etc.
Ah, I seem to have found a way to accomplish what I need using the stack by/view by section of certain graphs. It would still be cool if it was easier to work with the date filters within MAQL, and be able to access values and what not
m
I see what you are after, thanks for further clarifying! Unfortunately this is not possible at the moment since MAQL does not allow the use of variables in the metric syntax, therefore I can only recommend using a hard coded value at the time, but I can certainly share your use case internally with our Product team.
p
🎉 New note created.