runningSum SALES order by RANK and presenting by CATEGORY


I try to aggregate measure sales by using runningSum with order by rank field and desc.
In the visual, I want to display the results in a horizontal stacked bar chart using field status.
rank is actually defined by status. for example ‘Shipping’ gets 1, ‘Delivery’ gets 2, ‘Activation’ gets 3 etc.
when dragging status field into Y axis box and sales field into value box, I get the error - “Table calculation attribute refence(s) are missing in field wells”.
I’ll appreciate an answer.


Afaik, table calculations such as runningSum() require the actual fields used in the definition to be present in the visual’s field wells. So, despite the fact that there is a 1 to 1 mapping between these fields, you cannot use a different field in the visual for it to work.

You should be able to create a new field, called Ranked Status as follows:

concat( toString({rank}),'. ', status)

This will create a new field with statuses that are prefixed by rank, example:

1. Delivery
2. Activation

You can then use this new field in the runningSum() calculation instead of {rank} and also in the Y axis field well.

(Note: you may need to adjust this field if you have more than 9 statuses)

thanks! this was helpfull