This is a typical and/or question in set analysis where I am stuck for a long time.
I want to sum the amount for those ids, where:
type_of_entry is both 'Revenue and Expense' or 'Revenue and Labor'
revenue type is 'CAF'
Expected ids are shown in bold colors
Eg...id 1 exists for both revenue and expense. Similarly, id 2 and 3 exist for both revenue and labor.
Result - > amount = 55 (5+40+10)
I have tried the below set analysis but is not working:
I would appreciate any help on this.
Regards
Sagnik
Script -
The p() function extracts the possible values based on your filter, in this case, it was Expense and Labor, and * operator does the and operation. In short, you can have all the desired ids , and then apply the revenue_type filter.
Similarly, there is an e() function that extracts the excluded values.
This answer is not mine, Mr. Sunny Talwar helped me to get the solution for this question. It worked.