Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I am having problem to obtain results from these logics using Custom Aggregation in the Group Recipe.
What I have is a table with columns : actual_compl_year, actual_compl_month, process_date_year, process_date_month, minus_date1, minus_date2.
So what I am trying to achieve is that,
If (actual_compl_year == process_date_year && actual_compl_month == process_date_month) then sum(case when minus_date1 IS NOT NULL THEN minus_date1 ELSE minus_date2)
To elaborate that exactly, if both year and months are same, then we go to add the minus_date1 of all rows, but if minus_date1 is empty we take minus_date2.
It is not clear what your other group settings and aggregations are, but one suggestion is:
- In a previous prepare recipe, using the Formula processor, create a column minus_datex that implements your logic if minus_date1 IS NOT NULL THEN minus_date1 ELSE minus_date2.
- Then in the Group recipe you can simple sum minus_datex
- One way to implement your conditions "both year and months are same" is add them to the pre-filter.
As I wrote, all of this depends on whatever else you are doing on the Group recipe.