how can i count all the records from serviceprice to grand total
Robbie Chandra wrote:
Clarisse Carneiro wrote:
Hi Robbie,
At the moment you have two aggregates: one to display the data of the booking on your popup and the other one to display the data of the room service.
A quick fix is:
1. Add another aggregate in your preparation.
2. In that aggregate do the Sum function aggregating on all the room services price from that bookingId.
3. Use that aggregate output on the Grand Total Expression + GetBookings(...).Total.
As a performance best practice you should use the SQL tool instead of the aggregate but if you are just starting don't over complicate :)
I hope it helped. If you have any doubt feel free to ask :)
Best regards,
Clarisse
There are other solutions, like @Zhou Shuai mentioned, counting it on the preparation - using a for each to go through the GetRoomServicesById List and save the data of that counting/sum on a local variable... then you use the local variable on the expression.
See what best fits your case :)
How can i use sum in expression?
If you use the aggregate scenario:
GetRoomServicesByIdSum.List.Current.ServicePriceSum + GetBookingsById.List.Current.Total
If you use the Count option:
TotalServices = TotalServices + GetRoomServicesById.List.Current.SumServ
TotalServices + GetBookingsById.List.Current.Total
Here is a picture with both solutions in place, just pick one:
Hope it helped,
Thanks.
its now all service price record has counted
You could count it in preparation then show on screen.
Regards,
Zhou Shuai
Zhou Shuai wrote:
How to count all records in column?
why I am unable to download this oml file