Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I'm just getting to grips with set analysis and am having some difficulty.
The following is my expression:
Sum({$ < GamingTransaction.game_tran_type={commission},UserMembership.com_percentage={50} > } GamingTransaction.amount/2)
I want to find all GamingTransactions which have 'commission' as their 'game_tran_type' and also have a UserMembership.com_percentage with a value of '50', and sum the amounts of these GamingTransactions and divide the result by 2.
As far as I can tell, the above expression gives me the GamingTransaction amounts of those with a GamingTransaction.game_tran_type={commission} OR those which have a UserMembership.com_percentage={50}.
How do I change the expression so that the resulting GamingTransactions have both attributes?
Thanks
Hi,
In the syntax of set analysis you give the extra selections that must be made for this expression.
So it is always an "and" situation.
Halmar
Halmar,
Thanks for getting back to me again.
Ok, that seems to be working, I may have just been wrong before. But now I would like to insert a function into my set analysis to check whether a number is Odd or Even, like so:
Sum({$ < GamingTransaction.game_tran_type={commission}, UserMembership.com_percentage{50}, Even(GamingTransaction.runner_id) > } GamingTransaction.amount/2)
However, I am getting an error in my expression syntax.
Is this possible, to put a function into the set analysis? If so, do you know the syntax for this?
Thanks
Hi,
I would do this like this:
In your script:
if(even(GamingTransaction.runner_id),1,0) as GamingTransaction.runner_id_EvenFlag
In your expression:
Sum({$ < GamingTransaction.game_tran_type={commission}, UserMembership.com_percentage{50}> } GamingTransaction.amount*GamingTransaction.runner_id_EvenFlag)/2
Succes!
Halmar