Skip to main content
Question
Asked a question last month

How can I achieve the total fees generated for multiple months? I want the Fee Department to select multiple months and generate the fee amount for those months altogether. Also, I want the month of February to have 29 days for a leap year and 28 days for a common year to generate the fee amount accordingly. I have created a Student Fee Payment app and have used the Multi-Select block to list out the months for the user to select and the Calculations & Logic block to generate the total fees.

Where am I?

In Clappia Community you can ask and answer questions and share your experience with others!

 

You can easily achieve Fee Calculation on a Monthly basis and also on a Daily basis using only Calculations & Logic Block in Clappia. You can select only 1 month or more than 1 month. Here's how:

 

1. Fee Calculation on a Monthly basis

Consider a simple app as shown below which includes the particulars of the student, months, fee per month and the total fees.

Blocks used in the app:

Single Line Text - Student Name.

Single Line Text - Roll Number.

Single Selector - Is it a Leap Year? (Options: Yes, No.)

Multiple Selector - Fee to be paid for the month/months? (Options: All the months in the year.)

Single Selector - Number of months.

Calculations & Logic - Number of days in the months selected (This is where the magic happens. The Formula is explained below the image. Keep reading.)

Single Line Text - Fee per month. (The app user will enter the number manually.)

Calculations & Logic - Total Fees Payable. (Formula: Multiplication of "Number of days in the months selected" and "Fee per month". Type @ and select the appropriate variables.)

Student Fee App - Monthly Fees and Leap Year - Clappia
Student Fee App - Monthly Fees and Leap Year - Clappia

Number of days in the months selected - The below formula will automatically input the number of days in a month selected or the total number of days in the months selected.

If the answer is 'Yes' for the leap year then February will have 29 days. If the answer is 'No' then February will have 28 days.

Formula: The variable for the 'Number of days in the months selected' in this app is @multiple_s. Replace this variable with the variable from your app.


IF(SEARCH("January",{multiple_s})>0,31,0)+ IF(SEARCH("February",{multiple_s})>0,IF({is_leap_ye}="Yes",29,28),0)+ IF(SEARCH("March",{multiple_s})>0,31,0)+ IF(SEARCH("April",{multiple_s})>0,30,0)+ IF(SEARCH("May",{multiple_s})>0,31,0)+ IF(SEARCH("June",{multiple_s})>0,30,0)+ IF(SEARCH("July",{multiple_s})>0,31,0)+ IF(SEARCH("August",{multiple_s})>0,31,0)+ IF(SEARCH("September",{multiple_s})>0,30,0)+ IF(SEARCH("October",{multiple_s})>0,31,0)+ IF(SEARCH("November",{multiple_s})>0,30,0)+ IF(SEARCH("December",{multiple_s})>0,31,0)

The Total fees will be calculated on a per month basis.

 

2. Fee Calculation on a Daily basis

The app layout is same. You just have to edit Fee per month to Fee per day and add 2 more blocks to it:

Single Line Text block - Number of days to exclude.

Calculations & Logic block - Applicable Days. (Formula: The following Subtraction will happen -  "Number of days in the month/months?" - "Number of days to exclude" . Type @ and select the appropriate variables)

Student Fee App - Daily Fees and not a Leap year - Clappia
Student Fee App - Daily Fees and not a Leap year - Clappia

Total Fees Payable will now be - Formula: Multiplication of "Applicable Days" with "Fee per day". 

The Total fees will be calculated on a per day basis.