Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to understand the FirstSortedValue() function in the script. If I have multiple lowest sort-orders...how can I still get a value in my output table object? When trying some expressions within the function like MinString(SortOrder) I get 'nested aggregation-errors' when reloading.
Please find attached an example.
Data:
LOAD * INLINE [
EmployeeID, Manager, SortOrder, RowID
1, B, 2, 1
1, C, 3, 2
1, A, 1, 3
1, A, 1, 4
2, D, 2, 5
2, A, 1, 6
3, F, 1, 7
];
Data2:
Load EmployeeID,
firstsortedvalue(Manager, SortOrder) as FirstManager Resident Data
group by EmployeeID;
Try adding distinct like below. Ignore the errors appearing and run the script
firstsortedvalue(distinct Manager, SortOrder)
Try adding distinct like below. Ignore the errors appearing and run the script
firstsortedvalue(distinct Manager, SortOrder)
Anbu has provided a better way to remove the redundancy in your data.
Wow, it works - that is weired...so is this actually a bug?
Yes
Is there any way of doing this from in the chart expression view? I'm having exactly the same problem, but it still persists even if I use Distinct.