Hi,
I am following a tutorial by Ryan Sleeper to color my circle marks depending upon where they fall in the worksheet (using the reference lines)
https://playfairdata.com/3-ways-to-make-stunning-scatter-plots-in-tableau/
~Tip # 3 about 2/3rd's the way down the webpage
I had to modify his formula a bit because of aggregation in my project.
IF [Profit Ratio] > WINDOW_AVG([Profit Ratio]) AND SUM([Sales]) < WINDOW_AVG(SUM([Sales])) THEN “High Profit Ratio & Low Sales”
ELSEIF [Profit Ratio] > WINDOW_AVG([Profit Ratio]) AND SUM([Sales]) > WINDOW_AVG(SUM([Sales])) THEN “High Profit Ratio & High Sales”
ELSEIF [Profit Ratio] < WINDOW_AVG([Profit Ratio]) AND SUM([Sales]) > WINDOW_AVG(SUM([Sales])) THEN “Low Profit Ratio & High Sales”
ELSE “Low Profit Ratio & Low Sales”
END
Mine
IF count([Late Sale]) > WINDOW_AVG(count([Late Sale])) AND count([Number of Records]) < WINDOW_AVG(count([Number of Records])) THEN 'High Late Sales & Low #Sales'
ELSEIF count([Late Sale]) > WINDOW_AVG(count([Late Sale])) AND count([Number of Records]) > WINDOW_AVG(count([Number of Records])) THEN 'High Late Sales & High #Sales'
ELSEIF count([Late Sale]) < WINDOW_AVG(count([Late Sale])) AND count([Number of Records]) > WINDOW_AVG(count([Number of Records])) THEN 'Low Late Sales & High #Sales'
ELSE 'Low Late Sales & Low #Sales'
END
I have a valid formula, but everything falls under the ELSE statement and shows: 'Low Late Sales & Low #Sales'
I believe I have set something up incorrectly, but not sure what.
I have a sample workbook and I'll keep trying to solve it.
Thanks,
Brent
@Brent Van Scoy
Hi, well I have created two options, because I did not understand which use case you are using:
Segmentation
IF count([Late Sale]) > WINDOW_AVG(count([Late Sale])) AND count([Number of Records]) < WINDOW_AVG(count([Number of Records])) THEN 'High Late Sales & Low #Sales'
ELSEIF count([Late Sale]) > WINDOW_AVG(count([Late Sale])) AND count([Number of Records]) > WINDOW_AVG(count([Number of Records])) THEN 'High Late Sales & High #Sales'
ELSEIF count([Late Sale]) < WINDOW_AVG(count([Late Sale])) AND count([Number of Records]) > WINDOW_AVG(count([Number of Records])) THEN 'Low Late Sales & High #Sales'
ELSE 'Low Late Sales & Low #Sales'
END
and
Segmentation 2
IF sum([Late Sale]) > WINDOW_AVG(sum([Late Sale])) AND sum([Number of Records]) < WINDOW_AVG(sum([Number of Records])) THEN 'High Late Sales & Low #Sales'
ELSEIF sum([Late Sale]) > WINDOW_AVG(sum([Late Sale])) AND sum([Number of Records]) > WINDOW_AVG(sum([Number of Records])) THEN 'High Late Sales & High #Sales'
ELSEIF sum([Late Sale]) < WINDOW_AVG(sum([Late Sale])) AND sum([Number of Records]) > WINDOW_AVG(sum([Number of Records])) THEN 'Low Late Sales & High #Sales'
ELSE 'Low Late Sales & Low #Sales'
END
In both cases, you have to right clic your color pill, and hover compute using and select region.
Attached both examples.
If this post assists in resolving the question, please "Upvote" it or "Select as Best" if it resolves the question. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.
Regards,
Diego