viz-centric / flair-bi

Flair BI - Open source Business Intelligence (BI) & Analytics platform
https://www.vizcentric.com/product.html
Apache License 2.0
27 stars 23 forks source link

Perc formula is not working #870

Open fabiofilz opened 3 years ago

fabiofilz commented 3 years ago

Hi @admin-vizcentric ,

The percentage formula is not working as expected.

Formula that I found in the code: update functions set value = 'SUM(field_name1)/SUM(field_name2)100', dimension_use = false, validation = '\w+([\w]+)\s\/\w+([\w]+)\s*\s\d+' where name = 'percent';

It worked after changing to this one:

update public.functions set value = '(SUM(field_name1)/SUM(field_name2)-1)100', validation = '(+\w+([\w]+)\s\/\w+([\w]+)+-\d+)\s*\s\d+' where name = 'percent'

Thank you. Fabio