Hi,
How can I do a median in Pigment ?
Thanks
Hi,
How can I do a median in Pigment ?
Thanks
Hi Alexandre,
We don’t have a function for calculating the median right now, but you can calculate it by combining a few modifiers and functions in a formula like the one below:rev2[RANK(rev2, Month, ASC, Sequential) IN (ROUNDDOWN((rev2[REMOVE COUNT: Country] + 1) / 2):ROUNDUP((rev2[REMOVE COUNT: Country] + 1) / 2))][REMOVE AVG: Country]
It might look a little complex, but see the below example to see it in action. We are calculating the median of the revenue across all countries for a given month.
Hopefully you can leverage this example for your own modelling :)
Cheers,
Hi, thank you for the tips! :)
Hey
Are you aware of any ways to accomplish something like this?
EDIT: I believe I was able to find what I needed in the article on the RANK function, using a unique dimension property along with the “&” symbol to reset across multiple dimensions. Thanks again for providing this example
Thanks,
Hello,
We’re happy to share that we now have a new Median aggregator using the REMOVE modifier which should help with these calculations!
Updated doc here:
I hope this helps with needing to calculate Median on metrics with multiple dimensionality.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.