Creating Another Dimension Value Dependent on Other Values of the Same Dimension

Hey all,

I’m trying to create another value of a dimension that would involve a calculation among other values of the same dimension

For example if we had blue, red, orange, green and purple t-shirts and i wanted a value that was the sum of blue and red minus the sum of orange green and purple, how would I go about doing that?

Solved Solved
0 1 763
1 ACCEPTED SOLUTION

JMJ1
Participant II

Hi,

You would create a specific measure for that, something like this:

  measure: total_specific_measure {
    type:sum
    sql: CASE

                  WHEN ${tshirt_color} in ( ‘Blue’,’Red’) THEN 1

                   WHEN ${tshirt_color} in ( ‘Orange’,’Green’,’Purple’) THEN -1

            END ;;
  }

View solution in original post

1 REPLY 1

JMJ1
Participant II

Hi,

You would create a specific measure for that, something like this:

  measure: total_specific_measure {
    type:sum
    sql: CASE

                  WHEN ${tshirt_color} in ( ‘Blue’,’Red’) THEN 1

                   WHEN ${tshirt_color} in ( ‘Orange’,’Green’,’Purple’) THEN -1

            END ;;
  }

Top Labels in this Space
Top Solution Authors