Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
alandilworth
Partner - Contributor III
Partner - Contributor III

Order By on Resident table not working

I'm trying to load a new sorted table from a resident table and my Order By condition is not working.  My load script is below.  Any insight will be greatly appreciated!  I'm stumped to why this is not working

[0 to 6 months]:
NoConcatenate LOAD
[Owner],
[Territory],
sum(AllTimeMegaSales)
Resident [0 to 6 months temp]
group by [Owner],[Territory];

[0 to 6 months sorted]:
NoConcatenate LOAD
[Owner],
[Territory],
[AllTimeMegaSales]
Resident [0 to 6 months]
order by [AllTimeMegaSales] ASC;

 

1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

I think you need to rename sum() field in your first load with AS clause.  Otherwise, the field name is sum(AllTimeMegaSales).

[0 to 6 months]:
NoConcatenate LOAD
[Owner],
[Territory],
sum(AllTimeMegaSales) as AllTimeMegaSales
Resident [0 to 6 months temp]
group by [Owner],[Territory];

[0 to 6 months sorted]:
NoConcatenate LOAD
[Owner],
[Territory],
[AllTimeMegaSales]
Resident [0 to 6 months]
order by [AllTimeMegaSales] ASC;

View solution in original post

1 Reply
GaryGiles
Specialist
Specialist

I think you need to rename sum() field in your first load with AS clause.  Otherwise, the field name is sum(AllTimeMegaSales).

[0 to 6 months]:
NoConcatenate LOAD
[Owner],
[Territory],
sum(AllTimeMegaSales) as AllTimeMegaSales
Resident [0 to 6 months temp]
group by [Owner],[Territory];

[0 to 6 months sorted]:
NoConcatenate LOAD
[Owner],
[Territory],
[AllTimeMegaSales]
Resident [0 to 6 months]
order by [AllTimeMegaSales] ASC;