Hi Prem,
hope below sql useful
select gja.LEDGERDIMENSION,gja.LEDGERACCOUNT
,gja.RECID FROM GENERALJOURNALACCOUNTENTRY gja
where gja.RECID = 5637144580
declare @p_ledgerDimension as bigint;
select @p_ledgerDimension = gja.LEDGERDIMENSION
FROM GENERALJOURNALACCOUNTENTRY gja
where gja.RECID = 5637144580
select [1]+'-'+[2]+'-'+[3]+'-'+[4]+'-'+[5]
from (
select a.VALUEORDINAL, isnull(v.DISPLAYVALUE,'''''') as DISPLAYVALUE
from (
select 1 as VALUEORDINAL union all
select 2 as VALUEORDINAL union all
select 3 as VALUEORDINAL union all
select 4 as VALUEORDINAL union all
select 5 as VALUEORDINAL) as a
left join DimensionAttributeLevelValueAllView as v
on a.VALUEORDINAL = v.VALUEORDINAL and v.VALUECOMBINATIONRECID = @p_ledgerDimension
) as d
pivot ( max(DISPLAYVALUE) for VALUEORDINAL in ([1],[2],[3],[4],[5])) piv
;