how to convert this calculation?from filemaker calculation field?

good day everyone, i am a newbie here at outsystem. i am from filemaker pro before discovered this application and i see this very promising.

i am working on a Meter Reading mobile applicaton.and this is the calculation for our tariff rates.

can anyone help me to convert this code/calculation to a field?

I wish anyone could help.


Let([


   @C=Consumption;
   @calc=






Case(Type="R" and Billing_Remarks="";
  


Case(@C>=36;(@C-15-10-10)*21.56+472.5;
     @C>=26;(@C-15-10)*17.25+300;
     @C>=16;(@C-15)*15+150;
     @C>=10;150;

     @C*15) 

     ;






Type="C 1/2";

Case(@C>=36;(@C-15-10-10)*43.13+945;
     @C>=26;(@C-15-10)*34.5+600;
     @C>=16;(@C-15)*30+300;
     @C>=10;300;

     @C*30)

     ;






Type="G 1";

Case(@C>=36;(@C-15-10-10)*69+1512;
     @C>=26;(@C-15-10)*55.2+960;
     @C>=16;(@C-15)*48+480;
     @C>=10;480;

     @C*48)

     ;






Type="B";

Case(@C<=15;200;0;

     @C>=16;@C*20);


Hi mark,

Hope this oml will help .

You have to give 2 inputs : Consumption and type ...it will calculate accordingly.

Thanks.

Tariffcal.oml

wow thank you so much ma'am. it is what i really need .this helps me for my project.

I hope this is not the last time ma'am. since i am a newbie in this application.

Thank you again,


Hi mark,

Try this create this two entities and calculate tariff on switch case.


Hope this helps.

Thanks

Thank you for the response ma'am, but how do i put each calculation for each entities?i mean the format of my calculation, mentioned above.

Hi mark,

Hope this oml will help .

You have to give 2 inputs : Consumption and type ...it will calculate accordingly.

Thanks.

Tariffcal.oml

wow thank you so much ma'am. it is what i really need .this helps me for my project.

I hope this is not the last time ma'am. since i am a newbie in this application.

Thank you again,


Welcome mark ....

Good day ma'am, follow up question, i already used your instructions above and it works great, now i am trying to to add two entities for calculating the consumption of each consumer. this is the entities: Previous Reading(int) Present Reading(int) this is the calculation to get the consumption. consumption=Present Reading-Previous Reading. so simple yet i have problem saving it on my record. how do i put the calculation to execute in a save button along with your Save action?

Hi 

Add attribute it into the calculateTariff entity and update it on save action.

You have to follow this path to understand how to develop mobile application:

https://www.outsystems.com/training/paths/1/becoming-a-mobile-developer/

Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.