Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlikview user
I have some negative values in my dataset which is causing my background colour not to work effectively.
My expression is as follows, and I wanted to know where I would place the Fabs function in the expression
TB_Numerator is the value I need to wrap the FABS function around, without affecting the structure of the rest of the statement
Num(FirstSortedValue({<TB_Numerator={">=0"}>}Aggr(Sum(TB_Numerator), TB_Fact_Date, TB_Metric), -Aggr(TB_Fact_Date, TB_Fact_Date, TB_Metric)))
Kind Regards
Helen
Taking positive values and using fabs() are not similar. Having said that, if you want to ignore the negative values you could try something like:
Num(FirstSortedValue({<TB_Numerator={">=0"}>}Aggr(Sum({<TB_Numerator={">=0"}>} TB_Numerator), TB_Fact_Date, TB_Metric), -Aggr(TB_Fact_Date, TB_Fact_Date, TB_Metric)))
Try like this
Num(fabs(FirstSortedValue({<TB_Numerator={">=0"}>}Aggr(Sum(TB_Numerator), TB_Fact_Date, TB_Metric), -Aggr(TB_Fact_Date, TB_Fact_Date, TB_Metric))))
Or
Fabs(Num(FirstSortedValue({<TB_Numerator={">=0"}>}Aggr(Sum(TB_Numerator), TB_Fact_Date, TB_Metric), -Aggr(TB_Fact_Date, TB_Fact_Date, TB_Metric))))
May be this
Num(FirstSortedValue({<TB_Numerator={">=0"}>}Aggr(Sum(Fabs(TB_Numerator)), TB_Fact_Date, TB_Metric), -Aggr(TB_Fact_Date, TB_Fact_Date, TB_Metric)))
or
Num(FirstSortedValue({<TB_Numerator={">=0"}>}Aggr(Fabs(Sum(TB_Numerator)), TB_Fact_Date, TB_Metric), -Aggr(TB_Fact_Date, TB_Fact_Date, TB_Metric)))