Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected character ('1' (code 49)): was expecting comma to separate Object entries\n

A,sam Garcia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 18, 2019

Hi guys,

I was trying to create report.

this is the code that i used.

 

Whenever I try to execute the  report, 
this error appears :

 

{"service":"","errors":[{"message":"An unpredicted error occurred while executing service.\nThe root cause of the error is: Unexpected character ('1' (code 49)): was expecting comma to separate Object entries\n at [Source: (StringReader); line: 1, column: 6602]"}]}
-----------------------------------------------------------------
SELECT
[Day]
,SUM(Qty) as 'Qty'
,SUM(Shop) as 'Shop'
,SUM(Octopus) as 'Octopus'
,SUM(CreditCard) as 'CreditCard'
,SUM(Amount) as SalesByUS$
FROM (
SELECT
CAST (FORMAT (TxnDate, 'MMM - dd') as NVARCHAR(10)) as 'Day'
,sum(Qty) as Qty,
isnull(Shop,0) as Shop ,
isnull(Octopus,0) as Octopus,
isnull(CreditCard,0) as CreditCard,
sum(amount) as amount
FROM (
SELECT
CAST(sh.TxnDate as Date) as TxnDate,
CAST(SUM(
CASE
WHEN ProdCode = '1301100' THEN Qty*3
WHEN ProdCode = '1301000' THEN Qty*3
WHEN ProdCode = '1302000' THEN Qty*3
WHEN ProdCode = '1302100' THEN Qty*3
WHEN ProdCode = '2501100' THEN Qty*5
ELSE Qty
END
) as INT) as Qty
,CASE when CurrencyName1 = 'Online' THEN sum(Qty) end as Shop
,CASE when CurrencyName1 = 'Octopus Exception' THEN sum(Qty) end as Octopus ,
CASE when CurrencyName1 not in ('Octopus Exception', 'online') THEN sum(Qty) end as CreditCard ,
sum(NetAmount) as Amount
FROM Sales_H sh
INNER JOIN Sales_P sd on sd.TransNum = sh.TransNum
INNER JOIN Sales_Q st on st.TransNum = sh.TransNum
INNER JOIN STAFF ps on ps.StaffID = sh.CashierID
INNER JOIN BUY_CURRENCY bc on bc.CurrencyID = st.TenderID
WHERE CurrencyID NOT IN (1,16)
AND st.TenderAmount != 0
AND ProdDesc != 'PLASTIC BAG'
AND NetAmount != 0
AND month(sh.TxnDate) = $P{Month}
AND year(sh.TxnDate) = $P{Year}
GROUP BY cast(sh.TxnDate as DATE), CurrencyName1
) A
GROUP BY TxnDate, Shop, Concierge_Octopus, Concierge_CreditCard) tblFinal
Group BY [Day]

 

 

 

Can you help me how to fix this? thank you in advance!

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2019

Could you explain what this has to do with Atlassian stuff?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events