Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a query which may return no results as below:
LOAD Count(ProductID) as Critical
Resident Product
WHERE UnitsInStock <ReorderLevel
I display the Critical on a Gauge (Led) and when no result return from the query the Gauge dissaperas where I would like to show the number 0.
Also I tried to show the result of Critical on a Listbox to check if it is null or not nothing came up,
Briefly my question is; how can I show the result as 0 when there is no results?
Thanks
Max
Maybe just append something like this to your script after your query (Result is your table name, change it to your given table name):
if( NoOfRows('Result') ) = 0 then
LOAD * INLINE [
Critical
0
];
end if
Hope this helps,
Stefan
Could you try ensuring 0 is returned rather than null?
if(isnull(Count(ProductID)),0,Count(ProductID)) AS Critical
James