Re: IF function and FieldList

2014-05-23 Thread Arcadius Ahouansou
Thanks Erick.

Arcadius.


On 22 May 2014 22:14, Erick Erickson erickerick...@gmail.com wrote:

 Why not just return them all and sort it out on the app layer? Seems
 easier

 Or consider doc transformers I suppose.

 Best,
 Erick

 On Thu, May 22, 2014 at 10:20 AM, Arcadius Ahouansou
 arcad...@menelic.com wrote:
  Hello.
 
  I need to have dynamically assigned field list (fl) depending on the
  existence of a field in the response.
  I need to do something like
 
  fl=if(exists(field0),field0 field1,field2 field3))
 
  The problem is that the if function does not like the space.
  I have tried many combinations like double or quotes around the field
 list:
  fl=if(exists(field0),'field0 field1','field2 field3'))
  or
  fl=if(exists(field0),field0,field1,field2,field3))
 
  or parenthesis etc.
 
  Any help would be very appreciated.
 
  Thanks.
 
  Arcadius.



IF function and FieldList

2014-05-22 Thread Arcadius Ahouansou
Hello.

I need to have dynamically assigned field list (fl) depending on the
existence of a field in the response.
I need to do something like

fl=if(exists(field0),field0 field1,field2 field3))

The problem is that the if function does not like the space.
I have tried many combinations like double or quotes around the field list:
fl=if(exists(field0),'field0 field1','field2 field3'))
or
fl=if(exists(field0),field0,field1,field2,field3))

or parenthesis etc.

Any help would be very appreciated.

Thanks.

Arcadius.


Re: IF function and FieldList

2014-05-22 Thread Erick Erickson
Why not just return them all and sort it out on the app layer? Seems easier

Or consider doc transformers I suppose.

Best,
Erick

On Thu, May 22, 2014 at 10:20 AM, Arcadius Ahouansou
arcad...@menelic.com wrote:
 Hello.

 I need to have dynamically assigned field list (fl) depending on the
 existence of a field in the response.
 I need to do something like

 fl=if(exists(field0),field0 field1,field2 field3))

 The problem is that the if function does not like the space.
 I have tried many combinations like double or quotes around the field list:
 fl=if(exists(field0),'field0 field1','field2 field3'))
 or
 fl=if(exists(field0),field0,field1,field2,field3))

 or parenthesis etc.

 Any help would be very appreciated.

 Thanks.

 Arcadius.