-
1. Re: Creating calculated fields
Alex Kerin Feb 12, 2012 6:50 AM (in response to David Klass)1 of 1 people found this helpfulDifficult to answer without seeing the structure of your data. With that said, the first calculation could be a problem as this is operating at the row level (there's no aggregation - sum, max, etc), so number of records (i.e. rows) will always be 1.
Maybe try:
IF([TimeOutBRDays])<5 THEN 1 ELSE 0 END
COUNT([TimeOutBRDays])
and sum([field 1)/sum(field 2)
Don't multiply by 100 - let Tableau handle this as a percent.
If that doesn't help, then if you can post some of the data and the 'expected' result from this data, that would really let us see what needs to be done.
Don't you love the smell of Tableau on a Sunday morning? I need more coffee.
-
2. Re: Creating calculated fields
David Klass Feb 12, 2012 8:07 AM (in response to Alex Kerin)Thanks for the response. I altered a bit what you suggested and found that the following gave me what I wanted
SUM([Return_5_Days])/[CountRDate]*100
The calculated field: IF([TimeOutBRDays]/[Number of Records])<5 THEN 1 ELSE 0 END was named [Return_5_Days] and dividing by the calculated field [CountRDate] works with the SUM operator for the row level field. Thanks again. David