Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm trying to create a break down of booking group sizes. I want to group each booking (BooRefNo) by the number of seats sold into it (SoldSeats). So I end up with, for example:
Group size Count
1 50
2 220
3 140
etc... (numbers are examples, of course) any bookings with more than 10 tickets will be listed as '10+'.
this is what I have so far in my expression:
=if(sum(SoldSeats)<= 10,
Count({<SoldSeats = {"$ (=Sum(SoldSeats))"} >} BooRefNo),
Count({<SoldSeats = {">10"}>} BooRefNo))
My dimension is as follows:
=if(sum(SoldSeats) <= 10, sum(SoldSeats), '10+')
However, I'm just returning a blank table...
Thanks in advance for your help!
So an update on this... I have noticed that my (now updated) expression is not aggregating SoldSeats by BooRefNo, so this means that if, say, 2 seats are sold on a booking line within the entire booking and 3 are sold on another, then it lists them in both the '2 tickets' category and the '3 tickets' category. I want the expression to sum any SoldSeats where the BooRefNo's match. This is what I've tried:
=if(sum(SoldSeats) <= 10,
Count({<SoldSeats = {'$(=Aggr(Sum(SoldSeats), BooRefNo))'} >} BooRefNo),
Count({<SoldSeats = {'$(=Aggr(Sum(SoldSeats), BooRefNo))'}>} BooRefNo))
Please help!
Thank you