didnt know can run the query also i am just a beginner in sql…thanks @QMcKay will execute the query and update
Hello,
Can you help me with this ? I need to make a total of the people in the restaurant. I have the Person Count tutorial implemented.
I have this, but does not make a total
Person Count: {REPORT TICKET DETAILS:TT.Person Count:(TT=Person Count)}
Thx
Did you try {REPORT TICKET DETAILS:TT.Person Count.sum:(TT=Person Count)}
empty
Ok that was version 5 only feature. I couldn’t remember for sure.
1 Like
i am using sql to get total for guest
under custom report enter:
Total People:|@@GuestTotal
then goto automation -> scripts ->add script
name: any name
handler: @@GuestTotal same as define in custom report()
SELECT SUM([PeopleCount]) as [PeopleCountTotal]
FROM
(
SELECT
CASE isnull(charindex('{"TN":"People","TT":1,"TV":"',[TicketTags]),0)
WHEN 0 THEN 0
ELSE
(
CASE ISNUMERIC(substring([TicketTags],charindex('{"TN":"People","TT":1,"TV":"',[TicketTags])+len('{"TN":"People","TT":1,"TV":"'),2))
WHEN 1 THEN convert(int,substring([TicketTags],charindex('{"TN":"People","TT":1,"TV":"',[TicketTags])+len('{"TN":"People","TT":1,"TV":"'),2))
ELSE convert(int,substring([TicketTags],charindex('{"TN":"People","TT":1,"TV":"',[TicketTags])+len('{"TN":"People","TT":1,"TV":"'),1))
END
)
END as [PeopleCount]
FROM [Tickets]
Where Date > '{Start}' and Date < '{End}'
) gcsum
note: '{“TN”:“People”,“TT”: -----> people is my ticket tag defined so you will need to replace people with your tag
4 Likes
It worked like you. Thanks a lot, your a great guy !