Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Im stuck with the sort order in a hierarchy path.
It works to this point.
KstHierarchie:
Load
Cost_Center,
KST_Stufe_2 as KstHierarchiePath
Resident Kostenstellenhierarchie;
LOAD
Cost_Center,
if(isnull(KST_Stufe_3), KST_Stufe_2 & '\' & Cost_Center,
KST_Stufe_2 & '\' & KST_Stufe_3) AS KstHierarchiePath
Resident Kostenstellenhierarchie
where not isnull(KST_Stufe_2);
What i want to do now is to order the items in this hierarchy in a certain matter.
The sort order comes right out of the SAP table.
For example:
Item | SEQNR |
---|---|
Cost_Center_X | 1 |
Cost_Center_Y | 2 |
Cost_Center_Z | 3 |
But no matter what (order by....), it wont order in the right way.
Can somebody help me?
Cheers,
Phil
Can you provide some sample data? You can also try to add Order By in your load script.
Hi Philipp, have you tried a join?:
KstHierarchie:
Load
Cost_Center,
KST_Stufe_2 as KstHierarchiePath
Resident Kostenstellenhierarchie;
LOAD
Cost_Center,
if(isnull(KST_Stufe_3), KST_Stufe_2 & '\' & Cost_Center,
KST_Stufe_2 & '\' & KST_Stufe_3) AS KstHierarchiePath
Resident Kostenstellenhierarchie
where not isnull(KST_Stufe_2);
Left Join
LOAD Item as Cost_Center,
SEQNR as Sort
FROM ...