November 2, 200421 yr Hello all, i have a Question regarding the below Calculation. It is a Field where i want to display a Profit in Percent. If the Percent is below a certain Value, i like it to be red. To make this work, i had to define the profit_percent Field as a Text Field, otherwise the results would appear, but only black not color. However, if i make it a Text Field i cannot Round anymore to two Decimals. Does anybody know if i can fix it by using appropriate GetAsText or Number Functions? Only using the Round Function wont work. Case ( IsEmpty ( sale ) or IsEmpty ( cost ) or IsEmpty ( min_buy_break ) or IsEmpty ( min_sale_break ) or IsEmpty ( sale_cur ) or IsEmpty (cost_cur) ; "" ; Let( [ profit = profit_amount / cost profit_bad = GetAsText ( TextColor ( profit ; RGB ( 255 ; 0 ; 0 ) ) ); profit_good = GetAsText ( TextColor ( profit ; RGB ( 10 ; 140 ; 10 ) ) )]; Case( profit > 20; profit_good & " %" ; profit_bad & " %" ) ) ) regards, Overrider
November 2, 200421 yr Ugo is right; modifify the profit line to read profit = Round ( profit_amount / cost ; 2 )
Create an account or sign in to comment