Skip to main content

Can you explain the main differences between using the FILTER_TO_NULL and not using it in a PU function. I see that the results differ for the following 2 functions:

 

 PU_COUNT_DISTINCT (

   Domain_Table("CEL_ACTIVITIES_CMS_COMBINED"."USER_NAME")

   , FILTER_TO_NULL("CEL_ACTIVITIES_CMS_COMBINED"."CASE_ID")

   , "Grouping_All"."QUERY GROUPING" = '<%= QueryGroup %>' ) 

 

And

 PU_COUNT_DISTINCT (

   Domain_Table("CEL_ACTIVITIES_CMS_COMBINED"."USER_NAME")

   , "CEL_ACTIVITIES_CMS_COMBINED"."CASE_ID"

   , "Grouping_All"."QUERY GROUPING" = '<%= QueryGroup %>'  )  

 

 

 

Hi @lize.erasm11,

 

FILTER_TO_NULL can be used to make certain functions filter-aware, like PU-functions.

 

FILTER_TO_NULL considers the current FILTER state and only includes rows that pass the FILTER when calculating the result, as in your example of PU_COUNT_DISTINCT.

 

in that sense, FILTER_TO_NULL is like a filter "follow-up", ensuring that PU_COUNT_DISTINCT only uses data that matches your current FILTER. Without FILTER_TO_NULL the PU_COUNT_DISTINCT function works in isolation, not considering any filters you've set. This may explain the difference in results.

 

Hopefully this helped you in some way.

 

Kind regards,

Sverre Klein


Thanks for the answer, can you please elaborate on "Without FILTER_TO_NULL the PU_COUNT_DISTINCT function works in isolation, not considering any filters you've set. ". And, would you recommend I use the FILTER_TO_NULL?


Hi @lize.erasm11,

 

If you have put a FILTER statement on your component, then yes, use a FILTER_TO_NULL. This is because The PU-function now considers the current filter state. It only includes rows that pass the filter when calculating the distinct user count.

 

For your other questions regarding "Without FILTER_TO_NULL the PU_COUNT_DISTINCT function works in isolation, not considering any filters you've set.":

 

As stated in the documentation, the way PU-functions handle filters is different compared to the standard aggregation. In contrast to the standard aggregation, PU-functions ignore filters, meaning that if a filter or a selection is changed, the result of the PU-function is not recalculated.

 

https://docs.celonis.com/en/pull-up-aggregation.html

 

Let me know if you have any more questions!

 

Kind regards,

Sverre Klein


I would like to extend one drawback of FILTER_TO_NULL: it is super costly in performance.

So you should use it only if your use case requires it. Each FILTER_TO_NULL will increase loading times.

 

I am aware that quite often there is simply no alternative to it, just be thoughtful in usage and be aware that this is one of the main drivers of long loading times.


Reply