Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to create an expression that contains set analysis and combines it with getfieldselections() function.
I have tried :
sum({<TransactionDay={'=$(=(GetFieldSelections(SnapshotDay)))'}>}movement_quantity)
sum({<TransactionDay={'=$(#GetFieldSelections(SnapshotDay))'}>}movement_quantity)
as well as others. I am trying to implement that instead of a trigger in a field to correlate selections.
Is that possible??
Regards,
But my preference is to use P():
sum({<TransactionDay=P(SnapshotDay)>} movement_quantity)
It works even if no selections made, and no need to additional parameters.
Nikos, try putting the getfieldselections function into a variable
Hi Gianni,
I have tried
set vSyncTransactSnapshot=GetFieldSelections(SnapshotDay);
sum({<TransactionDay={'=$(#vSyncTransactSnapshot)'}>}movement_quantity)
this as well but it does not seem to work properly.
Regards
try without the # :
sum({<TransactionDay={'=$(=vSyncTransactSnapshot)'}>}movement_quantity)
or
sum({<TransactionDay={'=$(vSyncTransactSnapshot)'}>}movement_quantity)
Hi Giannis,
No luck yet.
I think I am going to try the trigger field selection
Regards
Try the concat function instead:
=sum({<TransactionDay={$(=concat(distinct chr(39) & SnapshotDay & chr(39), ','))}>}movement_quantity)
This has the added advantage where you don't have to specify the number of elements at which GetFieldSelections changes to a format like '12 out of 54'.
If you insist on GetFieldSelections or need it to get specifically the values selected, use:
=sum({<TransactionDay={'$(=GetFieldSelections(SnapshotDay,chr(39) &',' & chr(39), 100))'}>}movement_quantity)
where 100 is just a large number to prevent it to from changing the string to above or "NOT ...".
Hope this helps!
But my preference is to use P():
sum({<TransactionDay=P(SnapshotDay)>} movement_quantity)
It works even if no selections made, and no need to additional parameters.
That is a superb solution jerem1234.
Thank you very much.
Thanks for the help Michael your solution is way more elegant, thus I will mark this one as correct.