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

If -then- else statement error

Started by cognos4321, 15 Dec 2017 12:54:17 PM

Previous topic - Next topic

cognos4321

Hi ,

I am trying to use a detail filter on a report where 'pVersion' is a parameter and 'abc' , 'def' are attributes of a dimension in the cube. The statement below works fine.

If(?pVersion? = 'budget') then ( [abc]=1)
else ([def] =1)


But when I add another condition to the if statement it gives me 'XQE-PLN-0267'error

If(?pVersion? = 'budget' and ?pYear? =2017) then ( [abc]=1)
else ([def] =1)

I have tried using data items for version and year instead of parameter, working around with brackets also but nothing works.

Please advice what's wrong in the 2nd if statement.
I am working with cognos Analytics and  TM1 cubes as database.

Thank You.

cognos4321

Please let me know if there is some other information needed.
I have tried replacing it with case statement also but nothing works.


Thanks.

Kiran P

Quote from: cognos4321 on 15 Dec 2017 12:54:17 PM
Hi ,

I am trying to use a detail filter on a report where 'pVersion' is a parameter and 'abc' , 'def' are attributes of a dimension in the cube. The statement below works fine.

If(?pVersion? = 'budget') then ( [abc]=1)
else ([def] =1)


But when I add another condition to the if statement it gives me 'XQE-PLN-0267'error

If(?pVersion? = 'budget' and ?pYear? =2017) then ( [abc]=1)
else ([def] =1)

I have tried using data items for version and year instead of parameter, working around with brackets also but nothing works.

Please advice what's wrong in the 2nd if statement.
I am working with cognos Analytics and  TM1 cubes as database.

Thank You.
Hi

I am not sure why there was an issue but you can try replacing it with nested if.

If(?pVersion? = 'budget' )

Then
        if(?pYear? =2017)
             then ( [abc]=1)
             else ([def] =1)

Else
([Def]=1)

Regards
Kiran

Sent from my ZUK Z2132 using Tapatalk


cognos4321

Thanks for the reply , Kiran.

Nesting didn't work too.

So, here's what I did.

1) As mentioned earlier the below mentioned statement gives correct result
If(?pVersion? = 'budget') then ( [abc]=1)
else ([def] =1)


2) Used the year parameter alone which is causing issue
If(?pYear? = '2017') then ( [abc]=1)
else ([def] =1)

This gives me data only for the 'else' filter( [def] =1) and skips [abc]=1 on its own.

Tried working around with cast function thinking it could be something related to the data types but no luck.

Any help is appreciated.
Thanks