8 Replies Latest reply on Dec 16, 2016 8:13 PM by Shinichiro Murakami

# Need to count Rows based on their Version

I have a table that has info like this:

Item
Status
Version
1GoodA
2GoodA
4GoodA

I am trying to count the total entries for 'Good' and 'Bad' Items.

My condition that I need to be met (which I cannot figure out how to do in Tableau) is if the 'Bad' Item is Version 'A', then it remains in Status 'Bad' and is counted as a 'Bad' Item. However, if the Item is Version 'B'+ (anything besides Version 'A'), then I need it to be counted as a 'Good' Item instead of 'Bad'.

So in this example, I would have 4 Items counted to be 'Good' (because one 'Bad' is counted), and 2 Items counted as 'Bad'.

Does anyone know how to use Tableau to solve this problem?

• ###### 1. Re: Need to count Rows based on their Version

Jessica

I'm confused with your logic, maybe something wrong.

Anyway, assuming your expectation is below. formula should be

 Item Status Version Calculated 1 Good A Good 2 Good A Good 3 Bad A Bad 4 Good A Good 5 Bad B Good 6 Bad C Good

[Calculated Filed]

if [Version]="A" then [Status] elseif [Version]>="B" then "Good" end

Thanks,

Shin

• ###### 2. Re: Need to count Rows based on their Version

Hello Shin,

Thank you for responding!

The only thing I also need to consider is that it is not just B that needs

to get recounted, it is if the 'Bad' items are B, C, D, E, etc. then I need

then to be counted as 'Good'.

On Thu, Dec 15, 2016 at 4:44 PM, Shinichiro Murakami <

• ###### 3. Re: Need to count Rows based on their Version

Shin,

I have some more conditions to add.

1. So for 'Status', there are more than just Good and Bad. There are 5

different Sates, but I only want to focus on the Good and Bad ones.

2. The issue is that your calculation worked for changing the 'Bad' states,

but it also changed some other states that had Version A, which i do not

want to do.

3. Additionally, there are versions A,B,C,D,E, etc. but there are also

Versions 1,2,3,etc. I do not want to mess with the 1,2,3 ones. Your

calculation returned these values as null.

Is this enough detail for you? Sorry I was not clear before. I can provide

another table if this is not clear.

Thank you so much!

On Thu, Dec 15, 2016 at 4:53 PM, Jessica Martini <martinij@google.com>

• ###### 4. Re: Need to count Rows based on their Version

Please attach packaged workbook and illustrate the issue.

No one likes to receive requests one after another with text communication.

Thanks,

Shin.

• ###### 5. Re: Need to count Rows based on their Version

Attached is the .twb

So you can see on Sheet 1 that it is returning Null values for the numbers.

Also, it is changing the States that are listed as 'WIP' but I only want to

change the states that say 'Change'.

On Thu, Dec 15, 2016 at 6:12 PM, Shinichiro Murakami <

• ###### 6. Re: Need to count Rows based on their Version

TWB does not work at all.

Shin

• ###### 7. Re: Need to count Rows based on their Version

Attached is the .twbx

On Fri, Dec 16, 2016 at 10:13 AM, Shinichiro Murakami <

• ###### 8. Re: Need to count Rows based on their Version

Hi Jessica

I still don't understand fully, but could you check this works or not.

As the data set does not have enough data I can verify, added some and create new data.

That's the reason I'm not sure I can meet your expectations.

[Status calc]