Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ziabobaz
Creator III
Creator III

Color cell in PIVOT based on it's value

Hi,

I have Measures as rows and Valuelist(2017,2016,Diff,%) as Dimensions.

I want to color the "%" column as at the picture below:

Screenshot_48.jpg

if(ColumnNo()=4, ( if( Column(1) > 0,rgb(153,255,153),rgb(255,153,153)) ), )

The above formula works fine, but I want to dynamically reference the current column (in red color in the above formula), i.e. I want something like if ( Column( ColumnNo() ) > 0, but it won't work (as you can see, he ColumnNo returns vertical column numbers rather than horizontal. The RowNo won't work at all (I think it is because the Pivot uses Measure as rows, i.e. it is transposed.

Please, help.

5 Replies
OmarBenSalem

Can you please share a sample QVF file containing this table to work with?

Thanks

ziabobaz
Creator III
Creator III
Author

Please, see attached (dummy numbers)

shraddha_g
Partner - Master III
Partner - Master III

if(wildmatch(Valuelist(2017,2016,Diff,%),%),

if( Expression of that column >0,rgb(153,255,153),rgb(255,153,153))

)

ziabobaz
Creator III
Creator III
Author

if(wildmatch(Valuelist(2017,2016,Diff,%),%), - noted, thanks


if( Expression of that column >0

I know this, but i don't want to copy the whole expression, because it's huge. Therefore, I just need the result of the expression, not the formula. It is also faster in terms of performance.

alextimofeyev
Partner - Creator II
Partner - Creator II

Gleb,

I don't know how to solve your problem (because you indeed are trying to lookup values in rows, not in columns), but you don't have to copy the huge formula - you can put it into a variable, and use that variable in any measure or expression.