26
Views
3
Comments
Calculation in outsystem
Application Type
Reactive
Service Studio Version
11.55.3 (Build 63884)
Platform Version
11.33.0 (Build 44426)

Hi All, currently i've been doing a claim application that will count my mileage. And im having a problem on how to do the calculation. 

1. Need to calculate by month, example (15/1 - 15/2)

2. Need to calculate based on userID

3. Sum calculation for cost (Mileage)

Pls help me regarding this matter.

Regards,

Amirah


Example of Cost.png
2024-12-16 09-23-37
Toan Dinh

Hi @Amirah Syuhada 

Can you share your OML file or provide more details about the scenario? I understand the issue you're describing but I can't interpret the image clearly.


2024-09-12 02-43-38
Deepsagar Dubey

Hi @Amirah Syuhada 

I don't know your exact scenario but according to what i understood from your comment you can use group by & SUM aggregate function.

You can follow below OS docs for more details. 

Calculate Values from Grouped Data

Aggregate a Column into a Single Value

Thanks
Deep

UserImage.jpg
Nani

Hi, @Amirah Syuhada 

If you provide more details about you source info could be helpful to give better solution.

If aggregate is your source follow below steps 

1. GroupBy UserID
2. Add new attribute in aggregate and add the given function " DecimalToInteger(DiffDays( ReplaceYourDate , CurrDateTime()) / 30.0) + 1 "
3.Right click on Cost so you will have option like below screenshot and click on Sum.

There you go, you have the sum cost of based on user and for ever 30days.

Note: Make sure Cost attribute is (Integer or LongInteger or Decimal) DataType then only you get Sum Function in aggregate.

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