Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can I use functions inside set analysis, like so:
sum({$<ReservationDate={getfieldSelections(OtherReservationDate)}>} Sales)
Thanks!
Yes, but the syntax is very ugly:
sum({<ReservationDate={$(=chr(39) & replace(getfieldselections(OtherReservationDate),', ',chr(39) & ',' & chr(39)) & chr(39))}>} Sales)
The getfieldselections() function returns a list of comma separated values. I don't think set analysis likes that format, though. I believe it wants them in quotes, which is where the replace() and all the chr(39) values come in.
A much easier approach to at least try would be to use an IF. I suspect it would be slower, but it's hard to know without testing.
sum(if(ReservationDate=OtherReservationDate,Sales))
I haven't tested either. Might have bugs.
You can also compare 2 fields in set analysis. Thanks!
sum({$<ReservationDate=OtherReservationDate}>} Sales)