I'm using Web Intelligence in Business Objects 4.2 and I'm trying to create a new variable using the following IF/AND statement but can't seem to get it right:
=If([Safeguarding Ind]=1 And [Form Complete Ind] <> 1 then 1 else 0)
Error Message: Missing operator or closing parenthesis in 'Then' at position 54. (IES 10067)
I found a way to do it:
=[#Encounters] Where ([Safeguarding Form Incomplete] InList (1))
Related
I have been trying to screen scrape from IBM's mainframe and I got stuck trying to convert the Row and Col into a position (Function 99). I have tried my best to debug this simple error but I just cannot find what's wrong with it.
Debug.Print hllapi(99, "AR", 6, 53)
My sessions are connected, everything is working great except the Convert Position or RowCol (99) function I am trying to use. It keeps returning a status code of 9999 which indicates that my data string (i.e. "AR") is not uppercased or the letter P/R does not exist in the second character. ("Character 2 in the data string is not P or R or uppercased").
I have been unable to fix this despite trying all sorts of methods.
I'm writing a macro to cycle through a number of different spreadsheets that are in exactly the same format as each other. The source spreadsheets contain data in a table which occasionally contains the #NUM error (thanks to something going wrong in a different model!)
I have managed to account for all other error types, and some interesting formatting rules, using the below with a few other Case statements:
If IsNumeric(resultsarray(q,p) = false then
Select case ResultsArray(q,p)
Case IsError(ResultsArray(q, p))
ResultsArray(q, p) = 0
Case Left(ResultsArray(q, p), 2) = "0 "
ResultsArray(q, p) = 0
Unfortunately #NUM doesn't seem to fall into IsError's purview. Does anyone out there know how I can simply overwrite the error with a zero/0?
Thanks in advance!!
Steph
This #NUM error occurs if the input is not a valid number. On your situation i suggets you to check whether the input is number or not instead of error check. This way you can check #NUM error as well.(Or you can do it both) With IsNumeric(<input data here>) you can do it. So just add one more case (IsNumeric) to your select case.
I have a query calculation that should throw me either a value (if conditions are met) or a blank/null value.
The code is in the following form:
if([attribute] > 3)
then ('value')
else ('')
At the moment the only way I could find to obtain the result is the use of '' (i.e. an empty character string), but this a value as well, so when I subsequently count the number of distinct values in another query I struggle to get the correct number (the empty string should be removed from the count, if found).
I can get the result with the following code:
if (attribute='') in ([first_query].[attribute]))
then (count(distinct(attribute)-1)
else (count(distinct(attribute))
How to avoid the double calculation in all later queries involving the count of attribute?
I use this Cognos function:
nullif(1, 1)
I found out that this can be managed using the case when function:
case
when ([attribute] > 3)
then ('value')
end
The difference is that case when doesn't need to have all the possible options for Handling data, and if it founds a case that is not in the list it just returns a blank cell.
Perfect for what I needed (and not as well documented on the web as the opposite case, i.e. dealing with null cases that should be zero).
In my Lotus Notes script, i do have this piece of logic as shown below. This is basically for two SELECT statements, followed by Fetch for each of the SELECT statement separately and the SELECT is for the same DB2 table with a variation in WHERE clause. The error i'm getting is for the second FETCH. The error i'm getting is ---> Field count mismatch error:
count = 0
If (srccon.Execute(selectstatement, fldLst1) = 0) Then
Goto GetNextDoc
End If
count = srccon.Fetch(fldLst1)
If ( count = 0 ) Then
Goto GetNextDoc
End If
The above cursor select and fetch does not give me any error.
The cursor down which is for the same DB2 table with a slight variation
in WHERE clause is causing the error:
count1 = 0
If (srccon.Execute(selectstatement1, fldLst) = 0) Then
Goto GetNextDoc
End If
count1 = srccon.Fetch(fldLst) ---> The error is pointing to this line
and the error is
I would appreciate any help in this regard. I would also thank the gentleman who
did excellent solution for my previous problem for current date minus 30 days.
With much thanks
I suspect it's because when you call Execute, you're reusing the same LCFieldList object from a previous call. Execute and Select statements append their list of result fields to the object you pass them, so you must pass them an empty fieldlist -- one you just created. Otherwise you get a combined fieldlist of all the fields in the result sets of multiple calls to Select or Execute.
You may find the LotusScript chapter of this Redbook useful.
Could anyone say what is the wrong with the below statement.
Currently I'm working in cognos 10.1.1
case
when extract(month,_last_of_month (current_date))=1 then ('January')
when extract(month,_last_of_month (current_date))=2 then ('January','February')
end
I couldn't correct it.
The error code is qe-def-0459 cclexception parsing error
it should return only one value,
case
when extract(month,_last_of_month(current_date)) = 1 then 'January'
when extract(month,_last_of_month(current_date)) = 2 then 'January, February'
end
I also believe in all Case Statements in Cognos you must have an else condition as well. I don't have cognos in front of me and cant remember the syntax of the functions you are using but it looks good.
Also i remember in some versions of cognos you had to convert the eval expression to the same as the return type meaning since you are returning text instead of expr = 1 you would have to Cast(expre, varchar) = Cast(1, varchar) --- Not sure if this is the case in 10 but it definitely caused problems sometimes as recently as 8.3 and 8.4