Sometimes a desired sort order does not follow a natural alpha or numeric sort pattern. For example, there may be project phase names that should appear in charts in this specific order:
Design
Review
Budget
Implementation
One of the Sortby options available in chart properties is “Load Order”.
A specific Load Order for a field can be created by loading a dummy table with the desired order prior to loading the source data. The dummy table “PhaseSort” may be dropped after loading the source data.
// Load a dummy table to establish
// sort order for field “Phase”.
PhaseSort:
LOAD * INLINE [
Phase
Design
Review
Budget
Implementation
]
;
// Load the source data
Fact:
LOAD
ProjectId, Phase, Amount
FROM projects.qvd (qvd)
;
// Dummy table no longer needed
DROP TABLE PhaseSort;
-Rob
Thank you so much. I can’t believe this is not a function in the sort tab… Thank you again.
Hi Rob,
Someone from the Community solved it for my by proposing the Match function.
Is there any reason why you didn’t choose to use it?
Thanks,
Antoine
Hi Antoine,
The Match() method works, but can be harder to maintain if you have multiple charts or long list of values to maintain.