4 Replies Latest reply on Oct 26, 2018 6:41 AM by Pavel Sayenko

# How to get calculated customers segments

Hey there! Just started working with Tableau and 'suddenly' faced with some trouble.

There is a customer ID's and amount of daily profit fileds. So, I need to categorize all the customers by their total profit like this:

ID, Amount, Seg

A, 100, 'seg1'

B, 200, seg2'

C, 300, 'seg1'

...

There is no problem to calculate "Seg" filed. But it will works only with "ID" filed, wich make me a bit confused, cuz it is a huge data in real case and main idea using category is getting all the customers by a few rows.

So, how can I get something like this:

Seg,Amount

'seg1', 400

'seg2', 200

Thanks for any help

• ###### 1. Re: How to get calculated customers segments

Hi Pavel,

Drag Seg to rows

and

Amount to Text in marks section

you will get the aggregated amount for each segment

BR,

NB

• ###### 2. Re: How to get calculated customers segments

Hi, Naveen!

Unfortunatly that is not actualy what I've looking for.

The 'Seg' filed - calculated by some formula, e.g.:

if SUM([amount]) > 10 then "seg1"

elseif SUM([amount]) > 5 then "seg2"

else "seg3"

end

It means that I'm gonna get just a single row: "seg1 and total amount", which expected, cuz aggretation without ID's returning total amount and it's True for the 1st expression in formula.

• ###### 3. Re: How to get calculated customers segments

if {Fixed ID : SUM([amount]) > 10 then "seg1"

elseif {Fixed ID : SUM([amount]) > 5 and {Fixed ID : SUM([amount]) <=10 then "seg2"

else "seg3"

end

Write calculation Like Above You will get the O/P

BR,

NB

1 of 1 people found this helpful
• ###### 4. Re: How to get calculated customers segments

This is it! Thank you)