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! Go to Solution.
Hi,
You would create a specific measure for that, something like this:
measure: total_specific_measure {
type:sum
sql: CASEWHEN ${tshirt_color} in ( ‘Blue’,’Red’) THEN 1
WHEN ${tshirt_color} in ( ‘Orange’,’Green’,’Purple’) THEN -1
END ;;
}
Hi,
You would create a specific measure for that, something like this:
measure: total_specific_measure {
type:sum
sql: CASEWHEN ${tshirt_color} in ( ‘Blue’,’Red’) THEN 1
WHEN ${tshirt_color} in ( ‘Orange’,’Green’,’Purple’) THEN -1
END ;;
}