cancel
Showing results for 
Search instead for 
Did you mean: 

Golden Arrow not showing on Query

former_member239716
Participant
0 Kudos

Hey guys - is anyone able to state why the Golden Arrow wont appear on DOCUMENT NUMBER for my below query?

Not essential but would be nice to have - thanks

SELECT T0.DocNum AS 'Document Number'
, T1.CardType AS 'Supplier / Customer'
, SUM (T2.LineTotal) AS 'Total ex-VAT'
, SUM (T2.VatSum) AS 'VAT'
, SUM (T0.DocTotal) AS 'Document Total'
, T0.DocDate AS 'Posting Date'

FROM OPCH T0
INNER JOIN PCH1 T2 ON T0.DocEntry = T2.DocEntry
INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
WHERE T0.[DocDate] BETWEEN [%0] AND [%1] AND T0.[Canceled] = 'Y'

GROUP BY T1.CardType
, T0.DocNum
, T0.DocDate

UNION ALL

SELECT T0.DocNum AS 'Document Number'
, T1.CardType AS 'Supplier / Customer'
, SUM (T2.LineTotal) AS 'Total ex-VAT'
, SUM (T2.VatSum) AS 'VAT'
, SUM (T0.DocTotal) AS 'Document Total'
, T0.DocDate AS 'Posting Date'

FROM OINV T0
INNER JOIN INV1 T2 ON T0.DocEntry = T2.DocEntry
INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
WHERE T0.[DocDate] BETWEEN [%0] AND [%1] AND T0.[Canceled] = 'Y'

GROUP BY T1.CardType
, T0.DocNum
, T0.DocDate


ORDER BY T0.DocDate

Regards

Roy

Accepted Solutions (1)

Accepted Solutions (1)

former_member185682
Active Contributor

Hi Roy,

As I know the golden arrow is linked to the primary key of a table. In your case de primary key is DocEntry for the document table.

Hope it helps.

Kind Regards,

Diego Lother

former_member185682
Active Contributor

Hi Roy,

I forgot to mention. As you use a union clause, the golden arrow will not work 100%, because the golden arrow does not know what document the result is linked, then all the golden arrow will be connected with the last document table that you used, in this case OPCH.

Kind Regards,

Diego Lother

Answers (1)

Answers (1)

former_member239716
Participant
0 Kudos

Thanks, Diego and happy new year.

It's not essential so thanks for explaining 🙂

Regards

Roy

former_member185682
Active Contributor
0 Kudos

Hi Roy,

Happy new year. 🙂

Kind Regards,

Diego Lother