What's the best way to handle variable expressions that fail when no data is returned from the database?
The boolean expression i'm using [Month].[DiscountCheck]>0 works fine most of the time, but occasionally i get a RSV-RND-0089 Failed to evaluate expression: '[qDetail_Month].[DiscountCheck]>0'. error when no data is returned.
This expression is driving a render variable on a column to toggle it off and on.
Many thanks!
Hi,
I think using a function that returns a default value for null values will help you. Try:
coalesce([Month].[DiscountCheck], 0)>0
Im not sure what database type you are using, but this should work for SQL at least. If not post here what type of DB you are using and Im sure there is an equivilent function for it.
I tried to replicate your problem but I don't get an error when the result set is empty. I am on version 8.4.1
Did the coalesce idea work? My first thought was that it would still need a result set returned with a null value in order to coalesce it. Of course I am quite likely wrong and couldn't replicate the problem to see :P
Do you have "No Data Contents" defined for your list (assuming we're talking about a list)? Maybe that might help you out?
Actually i stilll got the same error after trying Coalesce.
Makes sense as colesce still requires there to be data. One to keep in mind is that the expression above is going against one of the queries. So if the expression is being evaluated at that level, will "No data content" setting have any effect on the conditional expression?
i wonder if there is a way to evaluate # of rows brought back.
Hi,
Why is the name different in the error to the expression used in the boolean variable?
Cheers,
Mrcool
Not sure if this will help...but worth a try...since you're variable expression is based on query item...
1.)try associating that query with page or
2.) if the data item in variable expression is sourced from same query that's associated with your target list object....click the properties for List and check the data item used in the expression...