I have looked very much and didn't find a solution for a gradient background for values in a table chart in Qlikview.
The scope is to have values in a sorted fashion (smallest to largest), and by their position in the list, by their position away from the middle of the list, color the background of the cells with red - to - white when the values are below the middle, and white - to - green when they are above.
Red is the smallest (-1 normalized) value, middle is white (0 normalized), biggest is green (1 normalized).
So use the following function and logic:
Colormix2( (NoOfRows(TOTAL) - rank(OurColumnName) + 1)/ceil(NoOfRows(TOTAL)/2) - 1, red(), green(), white() )
The formula would assign the ranked position away from the middle (-1 to 1) to the current value in the list.
If there are NULL's in the column, then NoOfRows(TOTAL) would perhaps render a wrong count, so use a NumericCount(aggr (... )) as in the following example:
(NumericCount(TOTAL aggr(
sum( {< %year_q={$(vMaxYearQ_1)}, year={$(vGlobalYear1)} >} alt(marketing_USD,0) )
, global_brand_select )
)
That was a big search and big result!