I was recently working on building Chart data for ANYCHART.
I needed the chart sorted by the branch name (Affil). My data strings were being build NOT in a random order, but by the internal ID sequence.
FIND Orders WHERE Orders.ob_Week=LoggedInRegularUser.ps_Week ORDER BY Orders.Affil
CAppendChartStrings
It was odd to me that it seemed like the ORDER BY was ignored.
Being on MS SQL SERVER, I ran a trace to see what was going on and found that INDEED the rows were being FOUND in my specified order, but somehow the next process (CAppendChartStrings) seemed to be losing the order.
While slowing my process down, I added
IN BATCHES OF 1
to the end and now my chart data is built in the order specified in the FIND
Final code that works:
FIND Orders WHERE Orders.ob_Week=LoggedInRegularUser.ps_Week AND Orders.Active>0 ORDER BY Orders.Affil IN BATCHES OF 1
CAppendChartStrings
Jaymer...