5 Replies Latest reply on Mar 30, 2016 8:31 AM by Michael Amato

# Customer segmentation in Tableau

I have to perform customer segmentation(New,active,lost) in tableau.

New customer : if his invoice date and first invoice date is in the same year he is a new customer

Active customer: if his invoice is there in current year and previous year

Lost Customer if invoice is not there in current year and its there in previous year

i was able to achieve active and new customer. please help me with deriving lost customer .

Please see the attached workbook with sample data.

• ###### 1. Re: Customer segmentation in Tableau

Hi keerthana,

SUM(IF [Date] >=[Start Date]-365 AND [Date] <=[End Date]-365 THEN [Sales] END)

to

IF [Date] >=[Start Date]-365 AND [Date] <=[End Date]-365 THEN [Sales] ELSE NULL END

• ###### 2. Re: Customer segmentation in Tableau

I tried but running into several issues. Did u get a chance to look into the workbook.

Its a year wise graph and in 2013 obviously all has to be new

but in 2014 u can see some new ..some active ..i need those who are in 2013 but not in 2014 as lost marked.

kindly help with a solution

• ###### 3. Re: Customer segmentation in Tableau

Hi,

I am using 9.o version so i am unable to open that workbook.

• ###### 4. Re: Customer segmentation in Tableau

Hi,

----Create a calculated field as below to get the details whether Customer is Older or Newer.

if {Fixed [Cusatomer] : max[Date])} = {Fixed [Cusatomer] : min[Date])} then "New Cusomer" else "Old Customer" end

----To know Active or Last Customer, follow the below step.

1) Create a calculated field as below

Name: Tran

Syntax:  {Fixed[Customer] : sum( if year([Date] = year([Today() ) then 1 elseif  year([Date] = year([Today() )-1  then 2 else 0 end ) }

2) Create another Caiculated fields as below to get the Transaction status:

Name: Tran Status

Syntax: if [Trans] = 1 then "Active Customer, There was no transaction in last year"

elseif [Trans] = 2  then "Lost Customer , There was transaction in Last year"

elseif [Trans] = 3 then "Active Customer, Transaction in current, Last Year"

else "Last Customer, There is no Transaction in Current, Last Year"

end

Best Regards

Kumar

• ###### 5. Re: Customer segmentation in Tableau

Hello,

Is there a workbook for this solution?

thanks

Mike