2 Replies Latest reply on Jul 4, 2016 2:29 AM by Mark Fraser

# count (customers in state) / count(all customers)

Hi Everyone,

Currently i am working with Tableau 9.0 . It seems to be silly if i ask this question to anyone. But suddenly i went into confusion and so posting this to you guys. Please explain it me with steps because i can't open the

How to calculate,

 count (customers in state) / count(all customers)

Customers - Customer Number

State : State

Can u explain it to me with Sample Superstore.

Regards

Lalitha Kameswari

• ###### 1. Re: count (customers in state) / count(all customers)

HI Lalit,

Use fixed function.The expression is like

{ fixed State : CountD(Customers)/ Count(Customers) }

Regards,

Venkata Sreekanth

• ###### 2. Re: count (customers in state) / count(all customers)

Hi Lalitha

Let's break it down...

Customer in a state

{FIXED [State] : COUNTD([Customer Name])}

Keep state 'fixed', and count all distinct customers within that state.

Superstore, Antwerp = 11.

All Customers

{CountD([Customer Name])}

We use LoD to circumvent the worksheet filters, and always count from the data source.

Superstore = 795

Final Calculation (just bring the 2 halves together)

{FIXED [State] : COUNTD([Customer Name])} / {COUNTD([Customer Name])}

11 / 795 = 0.026

The other solution is the 4th column, not sure where 0.4 comes from?!

Hope that helps

Cheers

Mark