The following recipe shows you a way to overcome a problem with the sort order when creating a range dimension. You create a calculated dimension to the group set of values as custom ranges and describe it as with labels such as "above 10", "< 30", "< 60", and "up to 100". If you sort it alphabetically, then it will not show in the same order. We can assign a numeric value to each label using the dual()
function. Using this approach, you can simply set the sort order of the dimension as numerical and it will sort correctly.
For this recipe, we will generate sales data in the script, as defined in the following script. Load the following script into the Data load editor
:
load round(rand()*100) as Value AutoGenerate(100);