Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Plan:
LOAD * INLINE [
Channel, Plan
Retail, 100
E-commerce, 50
Wholesale, 20
];
Concatenate(Plan)
Fact:
LOAD * INLINE [
Channel, Fact
Retail, 70
E-commerce, 20
Wholesale, 20
];
PlanFact:
LOAD Channel,
sum(Fact)/sum(Plan) as Result
Resident Plan Group by Channel;
Drop Table Plan;
I need get value in Text object from a 'Channel' field with the maximum result.
In this case must be "Wholesale"
If possible please add it to the file.
Thx.
May be this
=FirstSortedValue(Channel, -Aggr(sum(Fact)/sum(Plan), Channel))
FirstSortedValue(Channel, -Result)
It works fine.
But I missed something.
Result calculation is in Variable
vResult = sum(Fact)/sum(Plan)
Below variant doesn't work.
FirstSortedValue(Channel, -$(vResult))
May be this
=FirstSortedValue(Channel, -Aggr(sum(Fact)/sum(Plan), Channel))