I'm a little confused (...almost certainly me!). So you have a single column called Status, which has (in different rows) either A, B , C or D...you want to combine the rows that relate to A, B & C to create a new Column called E? How do you add A, B, & C? (or do you mean concatenate the strings?)
If you can post an example workbook that would be a great help. It helps understand the problem, and also see the "shape" of your data which will determine the best solution.
Hi Simon Runc -
Thanks for your response. You are correct, that I want to add A, B, C to make E. I don't mean concatenation, I want to make a column that include A, B, & C. I created a sample Tableau document to show you what I mean.
Please see attached.
I want to create another column under the Status type, E, that is the sum of A, B, and C. Does that help?
Tableau Example.twbx 10.1 KB
Thanks for the workbook...
So do you mean like this? (see SR tab on the attached)
For this I just created a calculated field with the formula
IIF([Status] = 'A' OR [Status] = 'B' OR [Status] = 'C',[Sales],NULL)
Combining Selected Rows.twbx 15.3 KB
Hi Simon -
Thank you for your prompt response.
It didn't seem to work (it said IFF is not a real statement).
Also, I see you removed status as a column. I need to keep status as a column since it's also broken out by years (2016 and 2017) - is that possible with what I am asking? Let me know if you need further information.
I really appreciate your help.
btw it's IIF not IFF, but you can use IF THEN ELSE if your more used to that syntax (Tableau allows for most known syntax)
OK, so you are referring to columns on the Viz, and not columns in the data? in which case what you are asking for here is to "increase" the grain of the data, beyond what dimensions it currently has (I think) and are wanting to double-sum certain rows (eg. You want the value 10 to be summed in for Status = A, but then you want to use that 10 again for status E). This can be tricky in Tableau as it's not Excel where you can self-reference cells and string together cells into any calculation (Tableau thinks like a database, using set-theory, meaning calculations are done over the entire column in one go). This, btw, is why Tableau can handle 10s - 100s of millions of rows and Excel struggles past a few hundred 1000.
I'm not sure if this will work for your final model...but here is a way we can double-sum...
First I created a measure per Status, and then we can use measure name/value to achieve this (as each measure is isolated, we can double-sum here).
So I created the following...
IF [Status] = 'A' THEN [Sales] END
IF [Status] = 'B' THEN [Sales] END
...etc. and then use the calculation from the first post for E (which I've renamed Sales E)...
Hope that helps, but if not...can you let me know a little more about the reason you are doing this (eg. lack of customisable grand total control) and what you are trying to get to, as there might be a better way (re-thinking the problem)
Combining Selected Rows.twbx 19.8 KB
Sorry for the delayed response, Simon.
This is exactly what I was looking for - thank you!