Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
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:
1. type_of_entry is both 'Revenue and Expense' or 'Revenue and Labor'
2. 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:
sum({<type_of_entry = {'Expense','Labor'}>*<type_of_entry = {'Revenue'}>*<revenue_type={'CAF'}>}amount)
I would appreciate any help on this.
Regards
Sagnik
Try this
Sum({<id = p({<type_of_entry = {'Expense','Labor'}>})*p({<type_of_entry = {'Revenue'}>}), revenue_type = {'CAF'}>} amount)
Try this
Sum({<id = p({<type_of_entry = {'Expense','Labor'}>})*p({<type_of_entry = {'Revenue'}>}), revenue_type = {'CAF'}>} amount)
Thank you so much!
It worked. I can see you used p() in the equation which filtered out the ids. I learned something new today.
Is there any document for these advanced functions which I can refer to?
You can check this document for set analysis