0
votes

can anyone explain why this statement is not ordering correctly please?

Sample Workbook:- http://1drv.ms/1TRizj8

Basic query:-

EVALUATE
SUMMARIZE(
    Data
    ,'data'[item]
    ,"TotalAmount", Sum(Data[Amount])
)

Result:-

Item    TotalAmount
Item1   3.95128609469091
Item2   4.24529815278904
Item3   4.19327473518058
Item4   4.11105035459714
Item5   4.41249125008144
Item6   4.17408171753715

Altered Query:-

EVALUATE
SUMMARIZE(
    Data
    ,'data'[item]
    ,"TotalAmount", Sum(Data[Amount])
)
order by "TotalAmount" 

Actual Result:-

Item    TotalAmount
Item1   3.95128609469091
Item2   4.24529815278904
Item3   4.19327473518058
Item4   4.11105035459714
Item5   4.41249125008144
Item6   4.17408171753715

Expected:-

Item    TotalAmount
Item1   3.951286095
Item4   4.111050355
Item6   4.174081718
Item3   4.193274735
Item2   4.245298153
Item5   4.41249125

Hopefully i'm missing something really obvious here... ultimately i just want to get a TOPN() based on the biggest sellers of my real data but whenever i try to order by it goes all squiffy :/

1

1 Answers

2
votes

worked it out with fresh eyes this morning, needed square brackets around the TotalAmount(!)

Query:

EVALUATE
SUMMARIZE(
    Data
    ,'data'[item]
    ,"TotalAmount", Sum(Data[Amount])
)
order by [TotalAmount] 

Results:

Item    TotalAmount
Item1   3.95128609469091
Item4   4.11105035459714
Item6   4.17408171753715
Item3   4.19327473518058
Item2   4.24529815278904
Item5   4.41249125008144

sigh

:)