# Web calculators case studies #1 – CSV tables

**CSV** **tables** with functions in the formula field is a very strong feature which brings your calculator to a new level. Allows you to calculate based on back end static data, use **discount codes** for payments and even more.

Explore case studies and get inspired on how to use CSV tables to grow your business in Calculoid **webinar recording**.

It is very simple to create a CSV table with Excel or Google sheets. Please note that it should be CSV UTF-8 format and the size should be no more than 2 MB. To upload the table using 'Tables' on the left menu. Choose file in 'New table' section, name your table and click on 'Add new table'.

## Case study 1 – How to prefill options in 'Select field'

There are two general ways of using a CSV table in Calculoid.

The first way is to use the file to prefill options in the 'Select field'. When the number of options is more than 10 it is much easier and faster to create a CSV and upload it to your calculator rather than typing in each option manually. To prefill options, once the table is uploaded, go to ‘Edit field’ > options > choose ‘table’ way of creating the options. Select the table needed and specify a column which will represent the ‘option name’ and a column for ‘option value’. It is that simple!

The second way of implementing data from the CSV file requires a ‘formula field’ and a little bit of “magic” which is represented by lookup function.

**Lookup function description:** lookup (searchable value, searchable value column id, result column id, table id). All the IDs needed can be found in the ‘table’ tab in the left menu, above each table.

## Case study 2 – Discount codes

Imagine creating a pricing calculator. Discount code for your most wanted clients is something you wish to have in it. To add this function you need to create a CSV table where you put all the codes with the discount rates. Once you upload the table, add two fields: Text field (Discount code) and Formula field. Your clients type in the code they have and formula calculates the discount. Example of formula to calculate the discount: F397557 * F397560 * lookup (F397559, 0, 1, 603).

**Example** of formula to calculate the discount: F397557 * F397560 * lookup (F397559, 0, 1, 603).

## Case study 3 – Text answer based on a code

Web calculators are not always about the numbers. To present a text as a result of the calculations store all the answers as well as the unique codes in a CSV table. Once the table is uploaded, create a formula field which will generate the unique code. The easiest way is to sum all the answers values. Make sure that each of your questions gives you a different exponent of 10 (10, 100, 1000 ext.). Example: answers to question 1 return 10 or 20, answers to question 2 return 100 and 200, answer to question 3 return 1000 or 2000. Then add a formula field with a lookup function, where the appropriate text will be shown based on generated code (answers given by your client).

## Case study 4 – Conversion rates

Many calculators require some static data on the back end. For example, you need to present your final price in different currencies. Store all the conversion rates in a CSV table and upload it. Then add this table to a ‘Select field’. In the formula multiply your final price by the dropdown with different currencies. Your results will be presented in the currency selected by your client.