COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: cognos05 on 07 Apr 2020 08:52:44 AM

Title: If Else not working with dimensional data
Post by: cognos05 on 07 Apr 2020 08:52:44 AM
Hi ,

I have a simple if else on a dimensional data source.

I have product  on rows and some calcs on the column ,

Then i bring in an additional calc like

if([Growth]<=0.04)
Then ('Other')
Else
('Team')

My result is empty , can i not have value in my if condition and then string in my result

if I use a number instead of other or team it works but not with string .

Thanks,
Title: Re: If Else not working with dimensional data
Post by: MFGF on 07 Apr 2020 02:37:15 PM
Quote from: cognos05 on 07 Apr 2020 08:52:44 AM
Hi ,

I have a simple if else on a dimensional data source.

I have product  on rows and some calcs on the column ,

Then i bring in an additional calc like

if([Growth]<=0.04)
Then ('Other')
Else
('Team')

My result is empty , can i not have value in my if condition and then string in my result

if I use a number instead of other or team it works but not with string .

Thanks,

Hi,

This sounds like the same use case Paul answered the other day?

https://www.cognoise.com/index.php/topic,36417.0.html

Did you try using a layout expression as he suggested?

MF.
Title: Re: If Else not working with dimensional data
Post by: cognos05 on 08 Apr 2020 11:19:37 AM
Hi MFGF,

I tried Layout expression and it works for below case, but its not working for my requirement .

Pd1 and pd2 are two members.

Set1 - (PD1 ,PD2)
Columns - Measures

Nested a crosstab space next to set1 and added a layout expression like ,
case Query.set1
when 'sfs'then 'sdsd'
etc.. and this works fine as intended .


Now my product set in crosstab rows is formed little bit different , they are not directly the members from product dimension


Dateitem1 - (Total(currentmeasure within set (Pd1,Pd2))
DateItem2 - (Total(currentmeasure within set(Pd3,pd4))
Set2 - set(Dataitem1,Dateitem2)

Now if I do
case Query.Set2
when 'dfdf' then 'sdsd'

it gives me crx-uda-2001 internal error .

Is there a different way i can group members so that above set will work .

Any help on this is really appreciated.

Thanks,