How to duplicate a row in a data cube

I have a data cube, containing rows with (simplified for the example): id, sent, open. ID is an identifier, sent is an int (how many sent messages), open as well (how many messages open).

I want to eventually have a table in a dashboard with for each column (sent, open in my case) the absolute value and a computed value (percentage in my case, which will eventually depend on a few other columns in a less simplistic setting).
So if the input is 42, 50, 20, I want to see:

> sent 50 100%
> open 20 40%

This is not directly possible (I cannot add a 2nd column to my table if it’s not in the data). That’s why I am trying to build a relevant datacube.

How can I build the relevant cube?

What I tried
Transpose, pivot, unpivot. None of them will do what I want.

I ended up thinking that I should duplicate each row, adding one column: for the first row the column (eg. calculation_type) would be ‘absolute’, for the 2nd it would be ‘percentage’. If I end up here, I should be able to display my data as wished, after a pivot on calculation_type.

But as far as I can tell, there are no transforms duplicating rows, and you cannot use twice the same source cube, so I feel stuck.

Test data
I am using a python step to simulate my real original cube:
return [[42], [50.0], [20.0]] and I expect to see the table I showed above.


Hi Guillaume,

Can you use a copy of the source cube and then use a union transform that includes duplicate rows?


Hi Steven,

Thanks but no can do. I already tried, but you are no allowed to use twice the same data cube. I could indeed completely duplicate the cube to have a full copy, but as it is a big warehoused cube it’s not a good idea resource wise.

With the help of support I eventually went another way to solve my problem (based on double unpivot in the cube and less work in the dashboard itself) so I do not need to actually duplicate my row.