Hi, I've followed and applied the steps in the do...
# gooddata-platform
p
Hi, I've followed and applied the steps in the documentation for Customize Date Filters in Dashboards, and yet the new date filter I have added does not show in either the insights creator or on the dashboard top left filter: New filter:
Copy code
{
  "from": -4,
  "granularity": "GDC.time.week_us",
  "localIdentifier": "relative_past_4_next_8_std_week",
  "name": "Past 4, Next 8 std weeks",
  "to": 7,
  "visible": true
}
Current filters available (see attached screenshots). I've: • Validated that the project ID is the same on the Grey Page URL used to Customize Date Filters as for the dashboard associated with the above screenshot • Validated that
visible
on the new custom date filter is set to
true
• Refreshed the grey page to ensure that the change has been saved properly What am I missing?
1
Alternatively, can I get that floating filter in my insights directly?
j
Hi @Philippe Hébert, Have you tried to change the default configuration for all dashboards or modify configuration for particular analytical dashboard? Supposing you tried to add the preset to default configuration for all dashboards you probably tried to modify dateFilterConfig metadata object. If you open URL https://{your-domain}/gdc/md/{workspace-id}/query/datefilterconfigs, how many metadata objects you see there? You should see only one. If you click through the the link do you see content of the dateFilterConfig including your change? Supposing you tried to modify metadata object of existing dashboard. It should look like this:
Copy code
{
   "analyticalDashboard" : {
      "content" : {
         "dateFilterConfig" : {
            "addPresets" : {
               "relativePresets" : [
                  {
                     "from" : -4,
                     "granularity" : "GDC.time.week_us",
                     "localIdentifier" : "relative_past_4_next_8_std_week",
                     "name" : "Past 4, Next 8 std weeks",
                     "to" : 7,
                     "visible" : true
                  }
               ]
            },
            "filterName" : "Date range",
            "mode" : "active"
         },
...
There is no way how you can set arbitrary floating range of weeks in Analytical Designer for insight currently. You can workaround it using MAQL expression
select M where Week (Sun-Sat)/Year between this-4 and this+7
Filter configuration in metadata object of dashboard may override the default date filter configuration defined by dateFilterConfiguration metadata object. There should be just one dateFilterConfiguration metadata object. If there are multiple I suppose only the first one will be used and other will be ignored.
p
Hi Jakub! Re: DateFilterConfig 1.
https://{your-domain}/gdc/md/{workspace-id}/query/datefilterconfigs
returns only one result 2. Said result in (1) returns the object I have modified, with the modification still there. 3. No overrides are present on tested dashboards Re: Custom date filter configs in Insights
There is no way how you can set arbitrary floating range of weeks in Analytical Designer for insight currently.
OK, that's sad :( Re: Workaround Thanks for the info. If possible I'd like to avoid doing custom MAQL to apply filters on data as I feel like this could lead to error-prone usage.
j
interesting. I have tried to modify the MD object myself and here is the result. Do you see the other options for weeks? If other week filtering options are missing you can check following help article https://help.gooddata.com/doc/growth/en/dashboards-and-insights/analytical-designer/v[…]/filters-in-analytical-designer/enable-weeks-in-date-filters
can you check if the option is present when you attempt to create new dashboard?
p
Hey Jakub, it seems what you did worked 😃 How did you go about it?
j
I have found the link to dateFilterConfig using query resource and added “?mode=edit” so that I can edit the content. In my case
https://{my-domain}/gdc/md/{workspace-id}/obj/9?mode=edit
but metadata object in your workspace may have different oid than 9. I edited the JSON and I submitted the change. Here is the content which is followed by meta section about dateFilterConfig metadata object such as author, category etc.:
Copy code
{
   "dateFilterConfig" : {
      "content" : {
         "absoluteForm" : {
            "localIdentifier" : "absoluteForm",
            "visible" : true
         },
         "allTime" : {
            "localIdentifier" : "allTime",
            "visible" : true
         },
         "relativeForm" : {
            "granularities" : [
               "GDC.time.week_us",
               "GDC.time.month",
               "GDC.time.year",
               "GDC.time.quarter",
               "GDC.time.date"
            ],
            "localIdentifier" : "relativeForm",
            "visible" : true
         },
         "relativePresets" : [
            {
               "from" : -4,
               "granularity" : "GDC.time.week_us",
               "localIdentifier" : "relative_past_4_next_8_std_week",
               "name" : "Past 4, Next 8 std weeks",
               "to" : 7,
               "visible" : true
            },
            {
               "from" : -6,
               "granularity" : "GDC.time.date",
               "localIdentifier" : "relative_last_7_days",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : -29,
               "granularity" : "GDC.time.date",
               "localIdentifier" : "relative_last_30_days",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : -89,
               "granularity" : "GDC.time.date",
               "localIdentifier" : "relative_last_90_days",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : 0,
               "granularity" : "GDC.time.week_us",
               "localIdentifier" : "relative_this_week",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : -1,
               "granularity" : "GDC.time.week_us",
               "localIdentifier" : "relative_last_week",
               "to" : -1,
               "visible" : true
            },
            {
               "from" : -1,
               "granularity" : "GDC.time.week_us",
               "localIdentifier" : "relative_last_two_weeks",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : 0,
               "granularity" : "GDC.time.month",
               "localIdentifier" : "relative_this_month",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : -1,
               "granularity" : "GDC.time.month",
               "localIdentifier" : "relative_last_month",
               "to" : -1,
               "visible" : true
            },
            {
               "from" : -11,
               "granularity" : "GDC.time.month",
               "localIdentifier" : "relative_last_12_months",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : 0,
               "granularity" : "GDC.time.quarter",
               "localIdentifier" : "relative_this_quarter",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : -1,
               "granularity" : "GDC.time.quarter",
               "localIdentifier" : "relative_last_quarter",
               "to" : -1,
               "visible" : true
            },
            {
               "from" : -3,
               "granularity" : "GDC.time.quarter",
               "localIdentifier" : "relative_last_4_quarters",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : 0,
               "granularity" : "GDC.time.year",
               "localIdentifier" : "relative_this_year",
               "to" : 0,
               "visible" : true
            },
            {
               "from" : -1,
               "granularity" : "GDC.time.year",
               "localIdentifier" : "relative_last_year",
               "to" : -1,
               "visible" : true
            }
         ],
         "selectedOption" : "relative_this_month"
      },
...
p
I am confused; I feel like this is exactly what I did 😅 And the object OID is 9 for me too.
j
I see the metadata object being queried in Chrome DevTools. Do you see your modification there?
p
From the dashboard or from the grey pages? I reiterate that your modification worked (it has been applied on my workspaces)
j
Great! I did not undestand it worked in your workspace too. Problem is solved then 🙂
1
p
@Jakub Sterba I tried again to modify the global dateFilterConfig object and it didn't work; instead in the interface it reset to the default filters. Here's what I did: 1. I navigated to
<https://votresucces-dev.on.gooddata.com/gdc/md/vyx9zuicsvv3rtjk9ry1myao6x4i2a40/obj/9?mode=edit>
2. I updated the configuration (see snippet) 3. I clicked on submit 4. I refreshed the dashboard on which I expected the change to appear (
<https://votresucces-dev.on.gooddata.com/dashboards/#/workspace/vyx9zuicsvv3rtjk9ry1myao6x4i2a40/dashboardId/4320>
) 5. The changes did not appear - instead the previously added "Past 4, Next 8 std weeks" disappeared (back to default). 6. I navigated back to
<https://votresucces-dev.on.gooddata.com/gdc/md/vyx9zuicsvv3rtjk9ry1myao6x4i2a40/obj/9>
and validated that my changes took effect (they did!) Did you do anything different from what I did when you successfully updated the dateFilterConfig object?
dateFilterConfig_json.js
j
I have tried to apply your configuration in my workspace and I see following error in web browser console:
Copy code
There were duplicate localIdentifiers in the date filter config: relative_next_week
and it is indeed the case:
{
“from” : 0,
“granularity” : “GDC.time.week_us”,
“localIdentifier” : “relative_next_week”,
“name” : “This + Next week”,
“to” : 1,
“visible” : true
},
{
“from” : 1,
“granularity” : “GDC.time.week_us”,
“localIdentifier” : *“relative_next_week*”,
“name” : “Next week”,
“to” : 1,
“visible” : true
},
{
“from” : 2,
“granularity” : “GDC.time.week_us”,
“localIdentifier” : “relative_next_week”,
“name” : “Second next week”,
“to” : 2,
“visible” : true
},
identifier must be unique
p
Oh that must be it! Let me retry
Corrected, resubmitted and it works 🙂
I didn't get an error on the erroneous try in the Grey Pages
j
The error is logged to console when you open dashboard which reads the configuration
p
OK, good to know!