Good morning,
I have created a query, where there are 4 different segments visible (Segment Value 1 to Segment 4). I am trying to figure out how I can implement Segment Value Names for all 4, but I can’t see how. Right now, I have only the Segment Value Name for Segment Value 1.
How can I implement this for the remaining 3 segments?
select
[GLJrnDtl].[Company] as [GLJrnDtl_Company],
[Company].[Name] as [Company_Name],
[GLJrnDtl].[FiscalYear] as [GLJrnDtl_FiscalYear],
[GLJrnDtl].[JournalNum] as [GLJrnDtl_JournalNum],
[GLJrnDtl].[JournalLine] as [GLJrnDtl_JournalLine],
[GLJrnDtl].[Description] as [GLJrnDtl_Description],
[GLJrnDtl].[JEDate] as [GLJrnDtl_JEDate],
[GLJrnDtl].[FiscalPeriod] as [GLJrnDtl_FiscalPeriod],
[GLJrnDtl].[Posted] as [GLJrnDtl_Posted],
[GLJrnDtl].[SourceModule] as [GLJrnDtl_SourceModule],
[GLJrnDtl].[JournalCode] as [GLJrnDtl_JournalCode],
[GLJrnDtl].[GLAccount] as [GLJrnDtl_GLAccount],
[GLJrnDtl].[SegValue1] as [GLJrnDtl_SegValue1],
[COASegValues].[SegmentName] as [COASegValues_SegmentName],
[GLJrnDtl].[SegValue2] as [GLJrnDtl_SegValue2],
[GLJrnDtl].[SegValue3] as [GLJrnDtl_SegValue3],
[GLJrnDtl].[SegValue4] as [GLJrnDtl_SegValue4],
[GLJrnDtl].[BookDebitAmount] as [GLJrnDtl_BookDebitAmount],
[GLJrnDtl].[BookCreditAmount] as [GLJrnDtl_BookCreditAmount],
(GLJrnDtl.BookDebitAmount- GLJrnDtl.BookCreditAmount) as [Calculated_Total],
[COAActCat].[CategoryID] as [COAActCat_CategoryID],
[COAActCat].[Description] as [COAActCat_Description],
[COAActCat].[Type] as [COAActCat_Type],
[COAActCat].[NormalBalance] as [COAActCat_NormalBalance],
[COAActCat].[ParentCategory] as [COAActCat_ParentCategory],
[COAActCat].[Sequence] as [COAActCat_Sequence],
[COAActCat].[NetIncome] as [COAActCat_NetIncome],
[GLAccount].[AccountDesc] as [GLAccount_AccountDesc],
[GLJrnDtl].[CurrencyCode] as [GLJrnDtl_CurrencyCode],
[GLJrnDtl].[DebitAmount] as [GLJrnDtl_DebitAmount],
[GLJrnDtl].[CreditAmount] as [GLJrnDtl_CreditAmount],
[COAActCatParent1].[CategoryID] as [COAActCatParent1_CategoryID],
[COAActCatParent1].[Description] as [COAActCatParent1_Description]
from Erp.GLJrnDtl as GLJrnDtl
inner join Erp.COASegValues as COASegValues on
GLJrnDtl.Company = COASegValues.Company
and GLJrnDtl.COACode = COASegValues.COACode
and GLJrnDtl.SegValue1 = COASegValues.SegmentCode
inner join Erp.COAActCat as COAActCat on
COASegValues.Company = COAActCat.Company
and COASegValues.COACode = COAActCat.COACode
and COASegValues.Category = COAActCat.CategoryID
left outer join Erp.COAActCat as COAActCatParent1 on
COAActCatParent1.Company = COAActCat.Company
and COAActCatParent1.COACode = COAActCat.COACode
and COAActCatParent1.ParentCategory = COAActCat.CategoryID
inner join Erp.GLAccount as GLAccount on
GLAccount.Company = GLJrnDtl.Company
and GLAccount.SegValue1 = GLJrnDtl.SegValue1
inner join Erp.Company as Company on
Company.Company = GLJrnDtl.Company
where (GLJrnDtl.FiscalYear = 2025)
Right, so just add the COASegValues table again a total of 4 times) to the BAQ
Something like this
GLJrnDtl.Company = COASegValues2.Company
and GLJrnDtl.COACode = COASegValues2.COACode
and GLJrnDtl.SegValue2 = COASegValues2.SegmentCode
Apologies for the late response, but this was what I needed. Thank you Jason for your answer.