Creating table calculation across multiple measures

I am looking to add a column that calculates lift/variance across testing groups. I have a bunch of measures I have created but how do I then create the variance column on top of all measures for test group A v. all measures for test group B?

The below is a hypothetical example and is after I have transposed the results so really it is a row for control with many columns and a row for Exp A. Essentially I want to add a row or column that is (ExpA - Control) / Control. So I have the lift across all the measures I have created.

bbd420a7-28d2-461b-9654-c5d5fb87417a.png
Solved Solved
0 3 4,829
1 ACCEPTED SOLUTION

Hi @jessie1990 

In order to have the difference/variance etc as a new row, you can use a derived table and union the row containing the differences/variances.

I have created an example below using Status and two measures from Order Items.

acea4702-6d26-4993-b6db-8ac43b98c6fc.png

By using union to combine the values by Status and comparisons between cancelled and processing, the difference is another row in the table.

In order to be able filter the table by user_id, I used a templated filter

filter: user_id {
type: number
}

Multiple filters can be added this way, and suggestions to the filters can be added using suggest_dimension

The results in the Explore are below:

cb2f3b06-7da7-46c3-a31c-1a997eb4f32a.png

I used the row_number() operator in the derived table to order the rows, so the differences can be the last row of the results.

I’ve used this dimension to order the rows and then hidden it from the results.

Let me know if you have any questions, and I hope this is a fix for you.

Naomi, Redkite

View solution in original post

3 REPLIES 3
Top Labels in this Space