Expressions
Im joining 2 fields in an expression rate + '"/" + uom
If Rate is null i dont want to display blank and
If UOM is null i want to display rate alone, not with the "/"
Is it possible for me to do these 2 IF statements in my expression.
Thanks
Rebekah
August 24th, 2011 9:59am
If Rate is null i dont want to display blank and
What do you want when rate is null?
Free Windows Admin Tool Kit Click here and download it now
August 24th, 2011 10:18am
Rebekah,
Assuming Rate and UOM are string values,
=Switch( Field!Rate.value <> "" and Field!UOM.value <>"" , Field!Rate.value+ '"/" + Field!UOM.value,
Field!Rate.value <> "" and Field!UOM.value = "" , Field!Rate.value ,
Field!Rate.value = "" and Field!UOM.value <> "", Field!UOM.value,
Field!Rate.value = "" and Field!UOM.value = "",""
)
or
Assuming Rate and UOM are integer values,
=Switch( Field!Rate.value >=0 and Field!UOM.value >=0 , Field!Rate.value+ '"/" + Field!UOM.value,
Field!Rate.value >=0 and Field!UOM.value <=0 , Field!Rate.value ,
Field!Rate.value <= 0 and Field!UOM.value >=0, Field!UOM.value,
Field!Rate.value <=0 and Field!UOM.value <=0,""
)
Regards,
Manoj
*Happy to help
http://fascinatingsql.wordpress.com/
August 24th, 2011 10:42am
Hi Rebekah,
Thanks for your post.
Based on the information you provided, I specify an expression for you:
=Switch( IsNothing(Field!Rate.value)=False and IsNothing(Field!UOM.value)=False, Cstr(Field!Rate.value)+ '"/" + Cstr(Field!UOM.value),
IsNothing(Field!Rate.value)=False and IsNothing(Field!UOM.value)=True,Cstr( Field!Rate.value),
IsNothing(Field!Rate.value)=True and IsNothing(Field!UOM.value)=False, Field!UOM.value,
IsNothing(Field!Rate.value)=True and IsNothing(Field!UOM.value)=True,""
)
Please have a try, if you have anything unclear, please feel free to let me know.
Thanks,
Bill Lu
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
August 26th, 2011 7:09am