# Calculation - Customer loyalty

This topic is 2753 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

I have a field, ‘CRM Category’ (I.e. Diamond, Gold, Silver) for B2C End Customer – and another field for Total purchase over last 3 months – Calculation - If customer purchases for Rs 10,000 over last three months, a Diamond Customer, If customer purchases Rs5,000 over last three months, Gold customer. If customer purchases less than Rs5, 000, silver customer

My question is for the calculation of the Gold customer as for the Diamond i will use the grater symbol and for Silver the less symbol.

Case ( Total_Revenue  < "\$10,000" ; "Diamond")

##### Share on other sites

"\$10,000" is text, not a number. Any number will be higher than this, because the \$ character precedes any digit in alphabetical order. Make sure you compare numbers to numbers.

Note also that the Case() function returns the first result whose test evaluates as true - so you need to mind the order of the tests. In your example, it could be either:

```Case (
TotalPurchase ≥ 10000 ; "Diamond" ;
TotalPurchase ≥ 5000 ; "Gold" ;
"Silver" )```

or:

```Case (
TotalPurchase < 5000 ; "Silver" ;
TotalPurchase < 10000 ; "Gold" ;
"Diamond" )```

• 1
##### Share on other sites

What would be value above 10,000?

##### Share on other sites

2 hours ago, Kishan_Canoo said:

What would be value above 10,000?

What do you mean?

##### Share on other sites

8 hours ago, Kishan_Canoo said:

What would be value above 10,000?

In Comment's first example:

TotalPurchase ≥ 10000 ; "Diamond" ;

≥ is the symbol for 'greater than or equal to'

In Comment's second example:

values less than 10,000 are specified in the first two tests and the final 'default result' of  "Diamond" will be applied to all records NOT identified in the first two tests so all records 10,000 or greater will be Diamond.  Read up in FM Help on using the Case() logical function.

Edited by LaRetta
• 1
##### Share on other sites

Thank you all. That works as expected. My problem is solved now.

##### Share on other sites

This topic is 2753 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account

• ### Similar Content

• #### fmp12 Portal Sorting with FM12 1 2

By mr_vodka,

• 36 replies
• 23,220 views
• #### FileMaker Coaches' Corner - Tip 8 - Converting from fp7 to fmp12 - FileMaker - FileMaker Experts

By Richard Carlton,

• 0 replies
• 1,000 views
• #### Select long term reservation by date

By Kishan_Canoo,

• 5 replies
• 1,259 views
• #### Outstanding Amount

By Kishan_Canoo,

• 2 replies
• 1,156 views
• #### Upload FM 12 database to FM Server 15 using FM

By jduncan71,