Hello guys, I've got a little problem. Right now I...
# gooddata-platform
j
Hello guys, I've got a little problem. Right now I've got an object with multiple date in it. Is their a way to force a specific date type in the query so when im using the metric in an insight and Im using the date master filter it will filter by this date for this specific column only E.g. : My object has Start date and Created Date, by default is seems to considered only the created date and I need a query that will count the number of id based on the start date Using the Date as in the filter is not working cause it affect the rest of the column also
m
Hi Jeremy, on the dashboard it should be possible for each visualization to define what date should the “master date fitler” be applied to as mentioned in this answer: https://gooddataconnect.slack.com/archives/C01USCF4S10/p1716836830811979?thread_ts=1716829597.671989&cid=C01USCF4S10 It should prefer the one selected in the insight if there is some. And to set it on the Insight-date-filter level, you can also select this directly in the date filter (“Date as”) dropdown.
j
as I mention using the date as for the filter is not working in that case. Like I'm building an insight will multiples metrics: I need the first column to be based on lead creation date and the reste of the column be on based un task/event Start Date
I need to pass that argument into the query but the documention doesnt provide any insight on how
m
Oh I see. Sorry I did not understand that initially. I assume you are using GoodData Platform (where you load data to it) rather than GoodData Cloud, correct?
j
yess and no worries im mainly french so maybe im not that clear sometimes
and yes we are using platform
m
Unfortunately there is currently not a straightforward way how to pass the date filter directly to the query from the UI. There is a way how to achieve that in GoodData Platform using additional date dimension and intermediate metrics however. You can use this “Disconnected date dimension” trick where you pass the date filter start and end to a metric with a value of another date dimension. Here is how it works: • you add one additional date dimension to your data model and keep it disconnected form any other datasets (let’s call this date Timeline) • you create two special metrics: ◦ _timelineStart =
SELECT MAX(Date (Timeline)) BY ALL OTHER EXCEPT Date (Timeline)
◦ _timelineEnd =
SELECT MAX(Date (Timeline)) BY ALL OTHER EXCEPT Date (Timeline)
• In your normal metrics that you want to filter by some specific date via the Timeline, you add
... WHERE Date (your date) BETWEEN _timelineStart AND _timelineEnd
◦ you can use have different dates for different metrics in your insight • last step is to set the Insight date filter to use the
Timeline
date for filtering ◦ note that you might need to do this before you add any metrics to the insight (otherwise the Timeline won’t show in the list). So first add the filter, then add the metrics. You might also see some a warning about the filter. But it should work.
❤️ 1
Note that you can only use this Timeline for filtering, not for viewing data by this date (since it is disconnected from your data). And in edit mode you might see some warnings regarding incompatibility of the filter. How it works under the hood is that when you filter with the “master date filter” set to “Timeline”, the
_timelineStart
and
_timelineEnd
metrics get as results numbers that represent first day and last day of your date selection. And these numbers are then passed to your other metrics and used for filtering by the actual date values.