Is it posible to use DefineField
and AggregateFunction.SumDistinct
with two fields in LLBL GenPro 3.1?
For example I have this:
ResultsetFields myFields = new ResultsetFields(2);
//I want this amount to be distinct but with specific userId
myFields.DefineField(UserFields.Amount, 0, AggregateFunction.SumDistinct);
myFields.DefineField(UserFields.Id, 1, "ResultCount", AggregateFunction.CountDistinct);
In SQL, I want it end up with something like:
SELECT DISTINCT SUM(u.Amount), u.Id
FROM Users u
INNER JOIN someOtherTablesat ON sot.UserId = u.Id
GROUP BY
u.Id
This join I have in LLBL and it duplicates amount, because someOtherTable
has few data for same user. I need that join for some another reason.
So, is it possible to do that with LLBL and how?