Heyho,
I need to find the second highest value within my repeatable group. Is it possible to find this value / entity with the Kernel Language ?
Happy regards,
Tjorben
Heyho,
I need to find the second highest value within my repeatable group. Is it possible to find this value / entity with the Kernel Language ?
Happy regards,
Tjorben
Hi @tjorben-atomic-moss,
I assume that you are computing the value. If so, I have just tried the following computation:
Precondition: AtLeastOneFieldFilled(RepeatableGroup*/NumberField)
Calculation: MaxValue(RepeatableGroup*/NumberField Having [RepeatableGroup/NumberField] < MaxValue(RepeatableGroup*/NumberField))
With the use of an extra computed field in which you store the highest value, you could increase the readability of the computation and that could be relevant for the performance:
First computation for the extra computed field HighestValue:
Precondition: AtLeastOneFieldFilled(RepeatableGroup*/NumberField)
Calculation: MaxValue(RepeatableGroup*/NumberField)
Second computation for the target computed field:
Precondition: FieldFilled(HighestValue)
Calculation: MaxValue(RepeatableGroup*/NumberField Having [RepeatableGroup/NumberField] < [HighestValue])
Thanks for the elegant solution @gildardo-cached-canyon
I wanted to give this a try in the Ad-hoc test so I modeled it (2024.06).
SecondHighestValue_DM.json (5.2 KB)
I also added a Confirm which is set to true for the row with the second highest value.