
1. Re: Tableau Prep calculations  Sum and Count missing
Jim Dehner Aug 30, 2018 11:22 AM (in response to Mitchell Hensman)1 of 1 people found this helpfulHi
it there you just have to get to them through Aggregate  at the end of a step select and Aggregate
a box will open with all the fields that can be aggregated  select your field and right click and select the aggregation
Jim
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.

2. Re: Tableau Prep calculations  Sum and Count missing
Mitchell Hensman Aug 30, 2018 3:34 PM (in response to Jim Dehner)Hi Jim,
Thanks for the response  It's helped me get close to what I'm trying to do but I'm not quite there yet. My calculation can't be done without aggregation, but I can't aggregate in a regular step and I can't calculate in an aggregate step Do you know what I'm doing wrong?
Thanks,
Mitch

3. Re: Tableau Prep calculations  Sum and Count missing
Mitchell Hensman Aug 30, 2018 3:36 PM (in response to Jim Dehner)Hi Jim,
Thanks for the response  It's helped me get close to what I'm trying to do but I'm not quite there yet. My calculation can't be done without aggregation, but I can't aggregate in a regular step and I can't calculate in an aggregate step Do you know what I'm doing wrong?
Thanks,
Mitch

4. Re: Tableau Prep calculations  Sum and Count missing
Jim Dehner Aug 30, 2018 3:52 PM (in response to Mitchell Hensman)A serious question. Is there a special reason you are doing counts and sums
in Prep v Tabeau proper. Prep was designed as a data cleansing and file
connection tool to restructure data for use in tableau. The aggregation and
calculation tools are to that end. Once the data structure is revised the
tools in tableau are used to analyze the data.
Just asking
Jim
On Thu, Aug 30, 2018, 5:44 PM Mitchell Hensman <tableaucommunity@tableau.com>

5. Re: Tableau Prep calculations  Sum and Count missing
Mitchell Hensman Aug 31, 2018 3:11 AM (in response to Jim Dehner)Sorry, that is a good question. After creating the calculated field I was going to pivot it with another field which I prefer doing in Prep (to keep the workflow together and for better visibility over the operations). Maybe there is a better way or I should just do it in Tableau proper!?
Thanks,
Mitch

6. Re: Tableau Prep calculations  Sum and Count missing
Jim Dehner Aug 31, 2018 3:47 AM (in response to Mitchell Hensman)Thank you for the response  pivoting in prep definitely has more flexibility than in Tableau proper  summing and counting are tools used to create another layer in the data (aggregation)  when uploading data into Tableau keeping all the data at the same level of granularity makes it easier to use 
I am not certain I understand the gaol  are you trying to create a new measure that is just the some of 2 (or more ) different measures in your data  if that is the case you can do that by just adding the 2 [value 1] + [value 2]  and Prep will add the 2 together at the lowest level of granularity  again not sure about "counting' what are you counting? each record is 1 so if the goal is to only count certain records you could do that with an if statement like if [value].10 then 1 else 0 end and take the field into Tableau as 1 and 0's but you could do the same in Tableau proper
Jim

7. Re: Tableau Prep calculations  Sum and Count missing
Mitchell Hensman Aug 31, 2018 5:23 AM (in response to Jim Dehner)Thanks Jim, I think I follow the above but not sure it allows me to do what I'm trying to do. I'll elaborate; the equation is as follows: SUM(IF [Category]="String" THEN [Number] END).
I'm trying to conditionally SUM numbers based on a string value in another column. Then I'd like to divide that by another equation with the same syntax: (SUM(IF [Category]="String" THEN [Number] END)/SUM(IF [Category]="String" THEN [Number] END).
How do you think you would do that?
Thanks,
Mitch

8. Re: Tableau Prep calculations  Sum and Count missing
Jim Dehner Aug 31, 2018 6:22 AM (in response to Mitchell Hensman)1 of 1 people found this helpfulLet me explain it this way
if you are working with only one record and your calculation will result in a new field that has a value for every record in the data set then you can try that in prepif you are summing data across multiple records (aggregating) then you are better off doing that in Tableau proper
Try it each way in prep and see if you get the results you want
Jim

9. Re: Tableau Prep calculations  Sum and Count missing
Mitchell Hensman Sep 3, 2018 12:54 AM (in response to Jim Dehner)Thanks for the help Jim. I've got the calculation the Tableau and the aggregation in Prep but I need the calculation before the aggregation (followed by a pivot) so I might need to send it from Tableau to Prep and then back to Tableau

10. Re: Tableau Prep calculations  Sum and Count missing
Mitchell Hensman Sep 3, 2018 12:56 AM (in response to Mitchell Hensman)Oh, just to add, the calculation in Prep without aggregation (one value for each record) returns null values.