Need a special offer?Find out if your project fits.
+

Conditional sum

Answered
emi asked on November 29, 2023

Hello, It is possible to write a formula like this:
if("Age" > 50 and "Age" < 65, sum("practice Amount") / average("capitasConvenio") , 0 )
What is wrong?
Thank you!

2 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster November 29, 2023

Hello, Emi!
 
Thank you for reaching out to us.
 
Kindly note that as Flexmonster works with aggregated values, you need to specify the aggregation that should be applied to each field in the formula. For example, you can use the max("Age") or min("Age"), so the working formula would look as follows:

if(max("Age")>50 AND max("Age")<65, sum("practice Amount")/average("capitasConvenio"), 0)

We have prepared a JSFiddle sample to illustrate the idea: https://jsfiddle.net/flexmonster/vdLtcb6x/.
 
Hope you will find our answer helpful.
 
Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster December 6, 2023

Hello, Emi!

Hope you are doing well.

Our team is wondering if you had some time to try our suggested approach and configure calculated values. Could you please let us know if it works well?

Looking forward to hearing from you.

Kind regards,
Solomiia

Please login or Register to Submit Answer