If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

error

Started by div_1234, 01 Sep 2011 12:05:46 PM

Previous topic - Next topic

div_1234


hi
I am creating new data item and i am putting expression like this ,i m getting error
what is wrong with this code?


if ([M].[v].[Col] = 'Pass / Fail') then
if ([M].[v].[W] = 1 ) then  replace([M].[v].[W],'1','P')
else (' F')



error : Parsing error near the position 73


Lynn

You need parentheses around each portion of the "if", the "then" and the "else". You also might need an "else" to go with the outer if statement.

It looks to me like the replace function in this case isn't necessary. You also need to pay attention to data types....is [M].[v].[W] a number or a string? If it is a number you'd use the = 1 condition. If it is a string you might want to enclose the 1 in single quotes.

  if ( [M].[v].[Col] = 'Pass / Fail' )
then (   if ( [M].[v].[W] = 1 )
       then ( 'P' )
       else ( 'F' )
else ( '' )