0 votes
1 view
in BI by (17.6k points)

In Tableau, I am trying to implement the following normalization logic:

https://stats.stackexchange.com/questions/70801/how-to-normalize-data-to-0-1-range

Basically, I want to take all values from a particular measure and scale them to values in the range of [0, 1]. This requires gathering the minimum and the maximum of a measure. What I want is...

(x - min(x)) / (max(x) - min(x))

If you create a calculated field using the above link's method, you get the "Cannot mix aggregate and non-aggregate" error.

This is where I am stuck. Is there a function and/or a trick to get this to work? 

1 Answer

0 votes
by (47.2k points)
  • Try this following code:

(MEDIAN(X)- TOTAL(MIN(X))) / (TOTAL(MAX(X)) - TOTAL(MIN(X)))

  • If the function only acts on one data point at a time, MEDIAN(X) will just return the value of the data point itself.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...