Ana Cosío
03/12/2025, 7:45 PMSELECT
(runsum({fact/AGG_DAILY_EVENTS.INS_CREATED}) -
runsum({fact/AGG_DAILY_EVENTS.INS_DELETED}))
with PARENT FILTER EXCEPT {label/CREATED_AT.hour}
However, with the above metric I'm excluding the date filter (CREATED_AT) from my visualization which is not the desired outcome 😐
Any ideas how I can achieve what I have in mind?
Requirements:
1. The metric should always calculate the running sum using the entire dataset, regardless of any date filters applied on the dashboard.
2. When a user applies a date filter on the dashboard, this should not alter the computation of the metric but should only affect what portion of the cumulative total is displayed.Ana Cosío
03/12/2025, 7:45 PMMauricio Cabezas
03/12/2025, 10:11 PMthis should not alter the computation of the metric but should only affect what portion of the cumulative total is displayed.
you mean, actually, the values you expect are NOT the same as the showed without filter? in that case you expect the sum ONLY taking into account the filtered date, right?
In that case need to ensure that the date filter is applied at the visualization level (as an attribute filter), not within the metric itself. Here's the correct MAQL that will give you the result you're looking for (please, confirm):
SELECT
(runsum({fact/ins_created}) -
runsum({fact/ins_deleted}))
Could you please check?Ana Cosío
03/12/2025, 10:52 PM"the sum ONLY taking into account the filtered date"
.
What I need is to show the running/cumulative sum including all previous dates
Hopefully this image explains it better. To give an example, I need a visualization that gives me the info on the purple box (assuming the user selected dates from week 39 to week 53) where the cumulative sum considers also the sum of prior values that may be excluded by the date filter. (see first image)
However, what I’m getting with the metric below is the second image. I’m expecting that the initial count should be around 15M but it looks like the metric recalculates the cumulative sum based on the period selected
SELECT
(runsum({fact/ins_created}) -
runsum({fact/ins_deleted}))
Ana Cosío
03/12/2025, 10:53 PMMauricio Cabezas
03/13/2025, 1:10 AMSELECT
(runsum({fact/ins_created}) -
runsum({fact/ins_deleted}))
with PARENT FILTER EXCEPT {label/CREATED_AT.hour}
You can see, I filtered by the dates under the red rectangle.Ana Cosío
03/13/2025, 8:27 AMAna Cosío
03/13/2025, 8:46 AMMauricio Cabezas
03/13/2025, 11:33 PMAna Cosío
03/17/2025, 8:48 PMSELECT
(runsum({fact/AGG_DAILY_IN_EVENTS.IN_CREATED}) -
(runsum({fact/AGG_DAILY_IN_EVENTS.IN_DELETED}))) WITH PF EXCEPT {label/CREATED_AT.day}
• Do you also see this issue on your end?
Thanks again for your help 😃🙌🏾Ana Cosío
03/17/2025, 8:49 PMJoseph Heun
03/18/2025, 10:39 AMWITH PF EXCEPT {label/CREATED_AT.day}
is blocking the filter from affecting the metric. This clause essentially states that the metric will work with all parent filters, except the CREATED_AT date filter.Ana Cosío
03/19/2025, 9:36 PMWITH PF EXCEPT {label/CREATED_AT.day}
is expected to exclude the filter from the metric (i.e., the calculation) but should not exclude the parent filter to be applied on the visualization.
Actually, the functionality works as expected in some cases (as can be seen in my image) but not for all as also shown on the examples I shared above.
Hope this brings a but more clarity to the issue 😃Ana Cosío
03/19/2025, 9:43 PMJoseph Heun
03/20/2025, 8:08 AMMauricio Cabezas
03/20/2025, 4:58 PMIncludes all parent filters, except for any filters specified as a comma-separated list of attributes.
The metric is taking into account all the filters but NO the specified filter in the metric. In your case would not matter how you filter Created at because will not be taking into account in the metric and calculation if you have the WITH PARENT FILTER EXCEPT
expression in there, s you can see in my example.
In there I have three metrics;
Light Blue: With EXCEPT CREATED AT -> will consider only the filter Id=All
, thus I will see all the records.
Light Green: without EXPECT CREATED AT -> that means it will take into account Created at filter, thus you can see only the data for This Quarter, as expected.
Red: With EXCEPT ID -> will take into account the Created At
filter, and not considering the Id=All
filter, but still is taking All, because is the default value.
I hope this explanation helps to understand better how works the WITH PARENT FILTER EXCEPT
expression.Ana Cosío
03/20/2025, 10:23 PMWITH PARENT FILTER EXCEPT
will omit the effect of the created_at filter in the metric/calculation ✅
However, I was expecting the created_at
filter to affect the timeframe I see in the graph/insight/visualization (in other words, timeframe of x axis). It does work in some cases as you can see in the images I provide, see images A, B, and D but it doesn’t work for other cases see images C and E.
1. What is the reason for the functionality to work as I expect in some cases but not in others?
In one of our previous messages it was described that it would work when “the filter granularity matches or is larger than the insight's granularity.” However it is not the case, as it can be seen on images C, and E
The metric I use in all examples is
SELECT
(runsum({fact/AGG_INS.IN_CREATED}) -
(runsum({fact/AGG_INS.IN_DELETED}))) WITH PF EXCEPT {label/CREATED_AT.day}
Thank you once again for all your support so far; it has been very helpful for me ! 😃👍🏾Ana Cosío
03/20/2025, 10:24 PMMauricio Cabezas
03/24/2025, 3:58 PMAna Cosío
03/25/2025, 4:25 PMMauricio Cabezas
03/25/2025, 6:55 PMZuzana Vranova
03/26/2025, 3:56 PMMauricio Cabezas
03/26/2025, 4:18 PMMauricio Cabezas
03/26/2025, 7:42 PMAna Cosío
03/26/2025, 7:45 PMAna Cosío
03/31/2025, 7:50 AMMauricio Cabezas
03/31/2025, 11:06 AMAna Cosío
04/02/2025, 11:31 AM