-
1. Re: Incremental count of strings in a column
Andrew Ball Dec 23, 2013 1:43 AM (in response to james.diaz)Hi James,
In order to make this happen, I've had to add a third column, in order to keep the rows separate. This is because otherwise Tableau groups the names from "Field 1" together.
I used the following table:
Row ID Field 1 Field 2 1 john 1 2 john 2 3 mary 1 4 jason 1 5 mary 2 6 george 1 7 joe 1 8 mary 3 To replicate counting, you need to use a calculated field of "INDEX()", and then make sure this is configured correctly.
I've also attached a copy of the workbook that demonstrates it. Hopefully you can get what you are after from this.
Andrew
-
Incremental count.twbx 13.0 KB
-
-
2. Re: Incremental count of strings in a column
james.diaz Dec 23, 2013 11:22 PM (in response to Andrew Ball)thanks for the help, andrew. is there a way to achieve the row id with another calculated field?
-
3. Re: Incremental count of strings in a column
Prem Reddy Dec 24, 2013 12:18 AM (in response to james.diaz)Hi James,
I haven't given a try but I suppose Count Distinct might help you in this case. This option is only available when you go with extract connection or else you need to write calculated field using CountD function.
Thanks,
Prem
-
4. Re: Re: Incremental count of strings in a column
Andrew Ball Dec 24, 2013 7:30 AM (in response to Prem Reddy)Hi James,
Not really. The suggestion of count distinct from Prem Reddy isn't going to help - sorry.
The thing is that a calculated field that you are wanting only occurs at row level, and if the values are the same, then there will be no difference between the rows with the same names.
Countd is an aggregated function, so occurs at aggregation time. This means that all same names are grouped together, and then each group counted once. Each name will have 1 against them.
Table Calculations happen after aggregation, so you need to have something to make the aggregated table have multiple rows for each name.
If you have no other fields to make the individual rows unique, then the only thing you can do is to unaggregate the measures. (Analysis -> untick "Aggregate Measures"). You can then remove RowID and change the Incremental field to be Compute Using Cell. However, this then groups the names together, so you don't get quite the result you were asking for.
See Sheet2 in the attached workbook
-
Incremental count.twbx 17.9 KB
-
-
5. Re: Re: Incremental count of strings in a column
james.diaz Dec 26, 2013 9:24 AM (in response to Andrew Ball)thanks for your help on this, andrew.
-
6. Re: Incremental count of strings in a column
james.diaz Mar 3, 2014 8:50 PM (in response to Andrew Ball)is it possible to do this using timestamp instead of row id? i have no row id to work with.