I know this has been beaten to death, but I’m not getting this.
I want to connect GLJrnDtl to InvcHed and have it show one line per invoice number
Just as a test, I created the BAQ with just the GLJrnDtl table. In the Display Fields tab I have the ARInvoiceNum & Group By selected. I also created a Calculated field (InvoiceAmt) with the formula:
sum(GLJrnDtl.CreditAmount)
Group By is also selected for that field.
But when I try to analyze, I get this error message:
Severity: Error, Table: , Field: , RowID: , Text: Column ‘Erp.GLJrnDtl.JournalNum’ is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Query returned 0 row(s).
Query has no more records to return.
Query execution total time: 24.8276 ms.
select
[Customer].[CustID] as [Customer_CustID],
[Customer].[Name] as [Customer_Name],
[InvcHead].[Plant] as [InvcHead_Plant],
[InvcHead].[InvoiceNum] as [InvcHead_InvoiceNum],
[InvcHead].[InvoiceDate] as [InvcHead_InvoiceDate],
[InvcHead].[ApplyDate] as [InvcHead_ApplyDate],
[GLJrnDtl].[JEDate] as [GLJrnDtl_JEDate],
[InvcHead].[DueDate] as [InvcHead_DueDate],
(GLJrnDtl.CreditAmount-GLJrnDtl.DebitAmount) as [Calculated_ExtAmt],
(GLJrnDtl.SegValue4 + ‘-’ + GLJrnDtl.SegValue2 + ‘-’ + GLJrnDtl.SegValue1 + ‘-’ + GLJrnDtl.SegValue3) as [Calculated_GLAccount]
from Erp.InvcHead as InvcHead
inner join Erp.GLJrnDtl as GLJrnDtl on
InvcHead.Company = GLJrnDtl.Company
And
InvcHead.InvoiceNum = GLJrnDtl.ARInvoiceNum
and ( GLJrnDtl.SegValue1 >= ‘600000’ )
inner join Erp.Customer as Customer on
InvcHead.Company = Customer.Company
And
InvcHead.CustNum = Customer.CustNum
The Segvalue1 filter is to show only the revenue accounts and not the asset entry