Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

syntax to color text in a calculated column

Been struggling with this....even though I'm sure the answer is v straightforward...

I have a straightforward table with a list of calculated %'s

I have introduced an additional measure that is called Movement and is calculated as follows:

"Column(2)-Column(7)" . I am now trying to come up with the syntax to make the movement Green if  = > 0 and Red if <0

For some reason  I cant make it work. Any help appreciated.

If it is required, the syntax for Column 2 is

If(Count({<Question={'COMM1','COMM2','COMM3','CL2'}>} Answer)<=19,'X',

Num((Sum({<Question={'COMM1','COMM2','COMM3','CL2'}>} Answer)/(Count({<Question={'COMM1','COMM2','COMM3','CL2'}>} Answer)*6)),'#,##0%'))

And for Column 7 is

If(Count({<Question={'COMM1','COMM2','COMM3','CL2'}>} Answer)<=19,'X',

Num((Sum({<[Month/Year]={"8/1/2016"}, Question={'COMM1','COMM2','COMM3','CL2'}>} Answer)

/(Count({<[Month/Year]={"8/1/2016"}, Question={'COMM1','COMM2','COMM3','CL2'}>} Answer)*6)),'#,##0%'))

Any help appreciated...

13 Replies
vvira1316
Specialist II
Specialist II

You save it in a folder. Then in your QS desktop just drag it

vvira1316
Specialist II
Specialist II

Expressions

Sum({<[Month/Year]={'8/1/2017'}>}COMM1)

Sum({<[Month/Year]={'8/1/2016'}>}COMM1)

=If(Column(2) <> 0,(Column(1) - Column(2))/Column(2), Null())

Text Color

=If(Sum({<[Month/Year]={'8/1/2017'}>}COMM1) > 20, RGB(0,0,255), RGB(255,0,0))

=If(Sum({<[Month/Year]={'8/1/2016'}>}COMM1) > 20, RGB(0,0,255), RGB(255,0,0))

=If(Column(2) <> 0, If((Column(1) - Column(2))/Column(2)*100 > 10,RGB(0, 0, 255), RGB(255, 0, 0)), Null())

Not applicable
Author

Perfect... Thanks so much

vvira1316
Specialist II
Specialist II

You are welcome. I'm glad it will help.