Hello community, Im new to GD. Is there a way to ...
# gd-beginners
t
Hello community, Im new to GD. Is there a way to create a new calculation that would ignore the dashboard slicer for date (for example by using BY ALL IN ALL OTHER DIMENSIONS EXCEPT) but at the same time having this calculation filtered out for current month? In simple words, set up this calculation sa that it keeps the monthly value and ignore the dashboard slicer.
m
Hi Tatiana, I believe you could simply disconnect the dashboard filter from the insight; you can achieve this while placing the dashboard in edit mode and then click the insight settings. How date filters interact can be found in our documentation here: https://www.gooddata.com/docs/cloud/create-dashboards/filters/date-filters-on-dashboards/#how-date-filters-interact
j
Hi Tatiana, BY ALL removes given attributes from execution context so individual cells in results will display data for all the values. BY ALL OTHER does it for all the attributes displayed in the result (e.g. for all the months). It however does not limit filters to be applied. WITHOUT PARENT FILTER is similar construct to block filtering. You can see the impact on attached table. The values of metric
SELECT {metric/total_sales} BY ALL OTHER
display value of rollup of the Total Sales for each year (Total Sales is additive metric so it equals also to sum of all the values).
And here is visible that filter for last 12 months worked well for both metrics
t
@Moises Morales this does not solve my problem because the user still needs to be able to view all the other data sliced
@Jakub Sterba am I able to filter out date dimension in the calculation? Or how do I set the calculation for this month?
j
Metric with BY ALL OTHER can be filtered by month. The filter can be applied as the filter from the user interface (like the example in the screenshot with Last 12 months) or using a WHERE clause in MAQL
t
@Jakub Sterba could you give me an example? I dont think I can make it work
j
The example is above. Maybe I do not understand what you want to achieve and what you mean by dashboard slicer. You want to apply dashboard filter (e.g. last 12 months) and display months Oct 2024-Sep 2025 and display identical value for each month which will by summary value for all displayed months?
t
No, I wish to calculate a field that is going to carry a date dimension (this month - which I am not sure how to do either) unimpacted by the date slicer on the dashboard. But I want the client to be able to filter out all the other calculations. Simply I want some calculations to stay static (this month) and some to be dynamic - user being able to filter them out
j
Have you tried
WHERE {label/date.month
}`=THIS(MONTH) WITH PARENT FILTERS EXCEPT {label/date.month}` ?
You may need to specify more date attributes in except if the filter is applied on different date granularities (e.g. this month or this quarter)
t
Its SELECT {metric} WHERE Month/Year(Date) = THIS WITHOUT PARENT FILTER for future reference
🙌 1