Hello everyone! Is there a way to apply a date ra...
# gd-beginners
l
Hello everyone! Is there a way to apply a date range filter differently across multiple insights on the same dashboard, specifically by filtering on only one boundary of the date range? For example, given a date range filter: • StartDate: 2024-01-01 • EndDate: 2025-01-01 • Insight 1: Should be filtered by both StartDate and EndDate (i.e., data between these two dates). • Insight 2: Should be filtered only by the EndDate, meaning it includes all data up to the EndDate, regardless of the StartDate. Is it possible to configure such selective filtering behavior per insight within the same dashboard? Thanks in advance for your help!
👀 1
m
Hi Lyes, please let me review and get back to you ASAP with more details
👍 1
Thanks for bearing with me - and my apologies in advance for the long response. Firstly, I would like to highlight how the KPI date dashboard filters interact with your Insights on your dashboards. When you add insights to the dashboards, they are filtered by the dashboard date filter. The insight may include their own date filters as well (see Create Insights). More details on this can be found here: https://help.gooddata.com/doc/enterprise/en/dashboards-and-insights/dashboards/filters-in-dashboards/date-filters-in-dashboards/#DateFiltersinDashboards-HowtheDashboardDateFilterandInsightDateFiltersInteract For example, please see the screenshot below, which shows 3 different insights, using 3 different Date Dimensions inside them, and they are all being filtered by the single dashboard date filter, which is on the KPI dashboard (Screenshot attached below) So if we go back to your examples: Insight 1 - Unfortunately, you cannot combine two date dimensions into one insight and use both date filters on the KPI dashboard at the same time. We do not support multiple date filters on the KPI dashboards. As in your example, filtered by both StartDate and EndDate filters on the KPI dashboard. However, you can use a different approach here - If I understand your requirements for your insights correctly, you have 2 dates: StartDate: 2024-01-01 and EndDate: 2025-01-01 - and you would like to calculate data between these two dates? If this is the case, you can use the following approach, which might be what you’re looking for here. In this case, we will need to create 3 metrics - Please see my testing dummy data below and let’s say we want to look at the last 12 months: Please note: I am using the THIS Macro in my metrics to show the last 12 months of data - But you can create your metrics to show any timeframe you require Mertic Name: Year (StartDate) = This
SELECT COUNT (User) WHERE Month/Year (StartDate) = THIS-11
Mertic Name: Year (EndDate) = This
SELECT COUNT (User) WHERE Month/Year (EndDate) = THIS-11
You would then combine these 2 metrics / 2 Date Dimensions - this 3rd metric you will use to calculate the data: Metric Name: StartDate - EndDate
SELECT Month/Year (StartDate) - Month/Year (EndDate)
You would still need to use StartDate or EndDate in the “View By” configuration in your insight (depending on how you want to visualise the data), and the primary dashboard filter would then filter the insight accordingly. As I mentioned previously, we do not support multiple date filters on the KPI dashboards. Insight 2 - With the above logic in mind: If you were to create an Insight which uses the EndDate inside it - The date dashboard filter would filter the insight, while your other insight(s) could be filtered by StartDate Hope this helps!
l
Hello, Thank you for your answer !! Just to make sure we are on the same page regarding the date range filtering on the dashboard: In my example, StartDate and EndDate represent the date range filter that the user sets dynamically on the dashboard. The user can change this date range at any time. My question is: Is it possible to filter two different insights on the same dashboard differently based on this single date range filter? • Insight 1: Should be filtered by the full date range, i.e.
StartDate < Data < EndDate
(This is the default expected behavior in GoodData — when applying a dashboard filter, it should apply to all insights.) • Insight 2: Should be filtered only by the EndDate, i.e.
Data < EndDate
(Meaning the StartDate part of the filter should not apply to this insight, even though it is set on the dashboard filter. And if the user changes the dashboard filter to a new range, e.g.
StartDate2 - EndDate2
, then Insight 2 should be filtered by
Data < EndDate2
) In other words, I want to know if it’s possible to have selective filtering on the same dashboard, where one insight respects both start and end dates, and another respects only one boundary of the date range filter. Thanks for your help and clarification!
m
Hi Lyes, I am afraid that it may not be easy to achieve this, since by definition, the filter is affecting all insights the same way, i.e., the applied date range will be applied to the insights. I would suggest disconnecting one of the insights from the date filter (this can be achieved from the insight settings) so it is not affected by it, and then keep the other insight connected to the date filter so it would filter to the expected time period. The only downside of this approach is that you would need to "hard code" the period on one of the insights via a MAQL statement, e.g. WHERE date period = ..., etc. My apologies if this is not the answer you were expected. May I know what you are trying to achieve by this? I would like to submit product feedback on your behalf.