Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm sorry it's a very stupid question.
I want have the difference between [Taux marge théorique : mai-2023] and [Taux marge théorique : mai-2022] in point .
but it's too long , I can't have 3,73 due to the fact that I ve put & ' pts'
So I've try to use the num() fonction but it's making a rounding
Can you help me ?
Best regard
May be you can try this
if([MARGE - Taux marge mois max A-1] < [MARGE - Taux marge mois max],
Num(Abs(([MARGE - Taux marge mois max A-1] - [MARGE - Taux marge mois max]) * 100), '0.00') & ' pts',
Num(([MARGE - Taux marge mois max A-1] - [MARGE - Taux marge mois max]) * 100, '0.00') & ' pts'
)
sadly it's does't work
Hi @Louveduval
I think the only issue in @Chanty4u's expression is that abs should be fabs:
if([MARGE - Taux marge mois max A-1] < [MARGE - Taux marge mois max],
Num(fabs(([MARGE - Taux marge mois max A-1] - [MARGE - Taux marge mois max]) * 100), '0.00') & ' pts',
Num(([MARGE - Taux marge mois max A-1] - [MARGE - Taux marge mois max]) * 100, '0.00') & ' pts')
I might be missing something, but I think that you can simplify all of that into:
Num(fabs(([MARGE - Taux marge mois max A-1] - [MARGE - Taux marge mois max]) * 100), '0.00') & ' pts'
As you are first checking whether it is going to give you a positive or negative answer, and then converting to positive if it is negative. The fabs function will leave positive values as positive, so it is quite safe to use regardless of which value is largest.
The other thing to note is that that function returns text, which will not sort correctly and could behave a bit odd if you have it in a table. You might therefore want to use a dual function, so that it sorts correctly numerically but looks correct in the KPI also:
Dual(
Num(fabs(([MARGE - Taux marge mois max A-1] - [MARGE - Taux marge mois max]) * 100), '0.00') & ' pts',
[MARGE - Taux marge mois max A-1] - [MARGE - Taux marge mois max])
Hope that helps.
Steve
Finally
I ve made something very simple