4 Replies Latest reply on Oct 12, 2012 10:29 AM by Alex Kerin

Hello All,

Tableau newbie here - love the product!

However having a bit of a strange problem with a really simple calculated field calculation - would appreciate any assistance.

So data source is an excel file - and I used the fields of HQ Code, POB, PC and Date to construct the above table in the BI.

HQ Code basically refers to a particular salesperson.  POB refers to the value of sales.  and PC refers to productive calls.

So drag the relevant fields to make that table upto PC.

Then now that I have my monthly POB and monthly PC - what I wanted to work out was the average sale per call - for each of the months.

In other words a calculated field formula of [POB]/[PC]

However as you'll see from the above .jpg - the number I get in the output is wrong.  So for example AP-01 has a July POB of 53,233.  And a July pob of 139.  So the figure should be 53233/129 = 382.  Instead I get this strange value of 7804 as you can see from the .jpg

Here are things I've tried so far to get it to work.

-Double checking that the raw data in excel is in "number" cell format.

-Noticed that the field was described as "float" in the calculated field bit.  So revised the formula to be integer instead i.e. something along the lines of (INT[POB)/(INT[PC])  or whatever.  The number changes slightly but completely the wrong order of magnitude.

Anyone able to help with what the formula should be? Dividing two numbers should be really easy - am confused.

Does this have anything to do with the monthly breakdown - i.e. calculated fields is not able to pick up the date field I've got going on in the table?

Any assistance would be much appreciated.

-

• ###### 1. Re: Really simple division calculation via calculated fields - but it just won't work! Please help.

Hi Ajay,

I believe the issue is that the fields being used in the calculation are not being aggregated. Change the formula to look like the following:

sum([POB])/sum([PC])

If this doesn't help, would you be able to post the workbook (twbx file)?

-Tracy

1 of 1 people found this helpful
• ###### 2. Re: Really simple division calculation via calculated fields - but it just won't work! Please help.

Dear Tracy,

Thanks so much for that - it worked.

Incidentally, this whole incident makes me realise that whilst I completely get and understand the drag and drop portion of Tableau - am much weaker on calculated fields.  Which is a shame as it's probably one of the most powerful tools available in the package.

Are there are resources kicking around on the net that'll help me build up some calculated field knowledge in a step by step manner?

-Ajay

• ###### 3. Re: Really simple division calculation via calculated fields - but it just won't work! Please help.

Hi Ajay,

Glad I could help. The best resources for learning how to write calculated fields are probably the forums and  the Knowledge Base, but most of all practice!

http://kb.tableausoftware.com/

http://onlinehelp.tableausoftware.com/current/pro/online/en-us/calculations_calculatedfields.html

http://community.tableau.com/community/forums/content?filterID=content~category[calculations]

-Tracy