Obtain Breakdown based on a different column

Hi there,

Is it possible to obtain nested values of a column immediately after the value they are related to from another column?

Basically, I have a value (Order Item Cost coming from a unique Order Item Id), which is always linked to several unique Order Item Option Ids (and their Cost). I would like to be able to have them in the same column as in here as in a sort of break down and (bonus point, but not crucial) potentially adding a row for the total after each unique Order Item Id) as well .

Please let me know if there is an easy way to achieve this directly within Metabase or if you have any SQL hints to provide or point me to.


Hi @ff9991
Metabase currently isn’t the best place to convert your data - it expects that your data is in a “sensible” format.
I don’t know which database you’re querying, but for MySQL you would use cursors and loop:
You’ll likely find much better help for such questions on stackoverflow.com or a forum dedicated to the database you’re querying.