Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Cell Values in expressions

 Post Reply Post Reply
Bonnell Lorne View Drop Down
New Member
New Member

Joined: 02 Apr 2013
Posts: 1
Post Options Post Options   Quote Bonnell Lorne Quote  Post ReplyReply Direct Link To This Post Topic: Cell Values in expressions
    Posted: 02 Apr 2013 at 11:59pm

In the <#Config> sheet I am trying to create an expression based on the Demo I saw for formatting Alternate Rows.
The expression there is <#if(mod(row(e32),2)=1;<#format cell(Yellow)>;)>

The "e32" in this case I assume gets updated with the row as it expands.

Is there a way to get the value of the current Cell, in the case where the expression is used in multiple columns in the same row.  

E.g for 
Cell H6 the expression "DS" is <#if(H6 ="DS";<#format cell(DS)>;)>
when applied to  I6 the expression needs to be <#if(I6 ="DS";<#format cell(DS)>;)>

What do I need to use in the Expression to get the value of the current cell?


Back to Top
Adrian Gallero View Drop Down
TMS Support
TMS Support

Joined: 18 May 2010
Posts: 1233
Post Options Post Options   Quote Adrian Gallero Quote  Post ReplyReply Direct Link To This Post Posted: 03 Apr 2013 at 5:43am

The main problem here is that H6 might change its contents before or after the expression, this sin't defined. If you use "Row(e32)" this is ok, because Row(e32) will be the same before and after the report runs. Also if H6 is constant, say "hello", that is ok too.

But if H6 itself has an expression or formula, then the result is not defined and this should not be used. This is because at the time of evaluating the expression the value of the cell hasn't changed yet, so instead of the string "result" it still is the string <#if H6...>

The way to deal with this is to not refer to cells that are not constant, and see to use the expression that gives value to the cell instead.

For example, let's define an expresssion H6Value = <#whatever defines h6>
and then in H6 you would write:
<#h6value><#if (<#h6value>="DS";<#format cell(DS)>;)>

Sadly you will have to do the same for i6.  To simplify a little, you could use an expression with parameters (see the "expression parameters" demo and in particular the "Format(value;minimum)" expression as it is this exact case). For this case you would define instead:

FormatDS(value) = <#value><if(<#value>="DS";<#format cell(DS)>;)>

and in H6 you would write <#FormatDS(<#whatever goes in h6>)>
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down