Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Simple problem, hopefully simple solution.
I have a sales table, each sale has two salespeople. Using set analysis the equation for one salesperson is something like
sum({< Salesperson1 = {"$(=getfieldselections(SalesPerson))"} SalesAmount)
That part works fine. However I'd like to do something like
sum({< Salesperson1 = {"$(=getfieldselections(SalesPerson))"} OR Salesperson2 = {"$(=getfieldselections(SalesPerson))"} SalesAmount)
Any suggestions on the syntax to make the "OR" work?
Thanks, Dave.
You can create a union the the sets
sum({< Salesperson1 = {"$(=getfieldselections(SalesPerson))"} >+< Salesperson2 = {"$(=getfieldselections(SalesPerson))"} >} SalesAmount)
This way you will not count a sale twice (if salesperson1 and 2 are in SalesPerson)
You can also try to use p() function:
sum({< Salesperson1 =p(SalesPerson) >+< Salesperson2 =p(SalesPerson) >} SalesAmount)
You can try this :
sum({< Salesperson1 = {"$(=getfieldselections(SalesPerson))"}>} SalesAmount) + sum({< Salesperson2 = {"$(=getfieldselections(SalesPerson))"}>} SalesAmount)
Regards,
Vincent
You can create a union the the sets
sum({< Salesperson1 = {"$(=getfieldselections(SalesPerson))"} >+< Salesperson2 = {"$(=getfieldselections(SalesPerson))"} >} SalesAmount)
This way you will not count a sale twice (if salesperson1 and 2 are in SalesPerson)
You can also try to use p() function:
sum({< Salesperson1 =p(SalesPerson) >+< Salesperson2 =p(SalesPerson) >} SalesAmount)
Thanks Erick, I just happened to stumble into the answer as well. This is the perfect result.
Dave
Hi Vincent -
Thanks for the quick reply, however what happens with your solution is that you are actually doubling the result in the event both Salesperson1 and Salesperson2 are the same person. You effectively are creating an "And" statement, not using the exclusion benefits of an "Or" statement.
Thanks, Dave