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

refer to current field in expression

I have a series of table objects for which I am developing a somewhat complex background color format expression.  All of the fields in the tables will use the same format.  Is there a way to refer to the field in which the expression resides without having to specify it by name?

For example my expression might be:

if(field1<0, do_somethign, do_somethign_else)  : this is fine but the expression needs to be change for every fieldx in the table

or is there some syntax like:

if(current_field<0, do_somethign, do_somethign_else)  : which acts on field1 if the expression is in field1 and so on...


Thanks in advance. 


5 Replies
Anonymous
Not applicable
Author

If I understand correctly, you're trying to vary the background colors by expression? If that's correct maybe try a nested if like;

if(sum(Sales)>1000, red(),

  if(sum(Sales)< 1000, blue(),

    if(sum(Sales)>1600, Yellow())))

Also a search for nested if or color by expression would yield a few examples.

Hope this helps

lakshmikandh
Specialist II
Specialist II

Hi ,

Try using $(FieldValue) , $(FieldName) . Not sure about this.

Thanks,

Lakshmikandh

Anonymous
Not applicable
Author

I looked at FieldValue. Its more of a lookup function, similar to CHOOSE

in Excel. It returns the value of an element number in an array list.

On Thu, Sep 22, 2016 at 2:39 PM, Lakshmikandh Karthikeyan <

Anonymous
Not applicable
Author

Can you share some sample data or qvf?

marcus_sommer

AFAIK there is no way to read/identify the own or parent object-level (for example dimension/expression/label ...) and their properties like name, content, index and so on. Therefore you will need to set it all manually.

- Marcus