Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
ziabobaz
Contributor II

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
Esteemed Contributor

Re: Color cell in PIVOT based on it's value

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

Thanks

ziabobaz
Contributor II

Re: Color cell in PIVOT based on it's value

Please, see attached (dummy numbers)

shraddha_g
Honored Contributor III

Re: Color cell in PIVOT based on it's value

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

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

)

ziabobaz
Contributor II

Re: Color cell in PIVOT based on it's value

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
Contributor II

Re: Color cell in PIVOT based on it's value

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.

Community Browser