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

case/if then else with multiple types

Started by francois.dierick, 28 Mar 2022 06:48:07 AM

Previous topic - Next topic

francois.dierick

Hi!

As a reader of this site, I have already found several answers to my questions, and I thank you for this :) Today, however, I can't find an answer...

In a query, I input items in types, based on several conditions and determining a deadline for each type. The problem is that an item can be inputed in more than one type => an item can have different deadlines.

When I create a case or an "if then else", as soon as a condition is found, Cognos retrieves it, and does not go any further:

IF ([PAP0051] in ('PAP0051')) THEN ('type1')
ELSE IF ([CA0011] in ('CA0011')) THEN ('type2')
ELSE('x')


Is it possible to "obligate" Cognos to read all the list of conditions and retrieve in the example the two values "type1" and "type2", and not stop at "type1"?

Thanks in advance for your help :)

MFGF

Quote from: francois.dierick on 28 Mar 2022 06:48:07 AM
Hi!

As a reader of this site, I have already found several answers to my questions, and I thank you for this :) Today, however, I can't find an answer...

In a query, I input items in types, based on several conditions and determining a deadline for each type. The problem is that an item can be inputed in more than one type => an item can have different deadlines.

When I create a case or an "if then else", as soon as a condition is found, Cognos retrieves it, and does not go any further:

IF ([PAP0051] in ('PAP0051')) THEN ('type1')
ELSE IF ([CA0011] in ('CA0011')) THEN ('type2')
ELSE('x')


Is it possible to "obligate" Cognos to read all the list of conditions and retrieve in the example the two values "type1" and "type2", and not stop at "type1"?

Thanks in advance for your help :)

Hi,

In your example, the calculation you are defining can only have one value for each row of data. There won't ever be a situation where it can contain two values for the same row - you'd need a second calculation to contain a second, different result. Here, Cognos is just being efficient, and as soon as it finds a True result, it stops processing - it deems itself to have found the one correct value, so processing any further would just be a waste of cpu cycles.

Can you explain what you're trying to achieve?

Cheers!

MF.
Meep!

francois.dierick

Thanks for your answer :) I would have liked to retrieve the different values on different rows, but apparently this is not possible... I will try to find another way (working with multiples columns for example).

MFGF

Quote from: francois.dierick on 28 Mar 2022 07:52:16 AM
Thanks for your answer :) I would have liked to retrieve the different values on different rows, but apparently this is not possible... I will try to find another way (working with multiples columns for example).

Hi,

The way to get a row duplicated like this would be to join it to another query that has the correct number of rows that correspond to the number of Types. If you do that, you risk your measures being double-counted in any summaries you do, so it's not something you'd do as a matter of course.

Cheers!

MF.
Meep!