BUG : unable to sort by calculated percentage field


#1


#2

How is calculation made? Did you write a formula in formula field?
What is the type of the field under present tab?


#3

Its a calculated field (fixed field with formula) from two fields (1 x currency and 1 x decimal) which we display as a percentage (override type). example. Formula = ({total} / {target}) * 100
The display is correct but when we sort the column data is treated alphanumerically.


#4

The sort is applied on database field. Not on calculated field.
Can you move your formula to customFunction or are total and target already issued by complexe calculation?
Drag your table field for total and write something like
IF({t}.target > 0, {t}.{f} / {t}.target * 100, 0)


#5

Hi Val, the calculation is made up of 2 different module values being summed .
im not sure it’s possible to perform the same action with a custom function is it?

https://FIBRECRM.tinytake.com/media/90448c?filename=1544606429250_12-12-2018-09-20-27.png&sub_type=thumbnail_preview&type=attachment&width=1199&height=322


#6

Stephen,
let’s try out.
Drag field Total won a second time
Then IF({t}.annual_target > 0, {t}.{f} / {t}.annual_target * 100, 0)
You will have to check the technical path for field “annual_target”
If fields involved are in a cstm table, please use {tc} instead of {t}


#7

Hi Val, that wont work as the target is in Users_cstm but the total won is in Accounts_cstm.


#8

ok. I understand now.
I think a kreporterfield would do, I’ll test that first.