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
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.
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
ThanksDeep
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 UserID2. 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.