window_sum( IF [your growth field here] < 0 THEN 1 ELSE 0 END )
You'll have to know what type of field your [growth field] is. If it's already and aggregate field, then the above should work. If it's a row-level measure, you'll have to make it an aggregate first, such as SUM( [your growth field] ).
And that's just one way of doing it. There are multiple ways to get that count, and some of them depend on how your data looks and how it's arranged on your sheet.
I have the growth at Row level.And trying to use the below formula its showing error.Can you help.
window_sum( IF (SUM([Growth]) < 0 THEN 1 ELSE 0 END ))
window_sum( IF AVG([Growth]) < 0 THEN 1 ELSE 0 END )
Both the above formulae showing errors.
Growth is calculated field for me.
Post a sample workbook. I can help if I have something concrete to work with.
Specify the version of Tableau you are using so I can modify it with the same version you have.
(Note to self: V 9.3 workbook)
See attached. I put the values for the calcs in tooltips so you can see them. These are table calcs, so I had to specify "Compute Using" and "At the level" settings to get Tableau to look at all the individual rows (customers) being evaluated, but not count up all the actual rows (so that we just get counts of countries on the sheet.)
Also look at Sheet 2. It's a duplicate of your sheet, but I changed the way we're differentiating red from green. Your way is fine, but I just wanted to show you that.
And finally, look at the [Growth] calc. I wrapped it in the ZN() function. This puts a zero value when there is null. I just did that to make sure I was matching the number of marks that Tableau was evaluating. (The null values were not getting counted in my calcs.)
I don't understand, though, what constitutes a top-30 customer. I just went with the filters that you already have. I am guessing that you have certain customers that you want in/out. I notice that if I select ALL for your filter, 8 more countries (dots) show up on the map. So there must be 8 countries that your top-30 don't operate in. Let's talk about this part more.
Book2 A.twbx 694.0 KB