COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Cognos_Jan2017 on 22 Apr 2020 09:46:23 AM

Title: Getting a Join to Work by Cast 2 Different Datatypes
Post by: Cognos_Jan2017 on 22 Apr 2020 09:46:23 AM
Relational Data.

Lineage ...
Field "AAA" in Query1 Datatype ...
National Language Variable Length Character

Field "BBB" in Query2 Datatype ...
Int 32

Both Fields are always in a number format 12345.

We need a Join between Query1 and Query2.

Can we Cast those 2 Fields to new Data Items where a Join would work?

Please let me know if you have any questions.

TIA, Bob
Title: Re: Getting a Join to Work by Cast 2 Different Datatypes
Post by: MFGF on 23 Apr 2020 07:26:02 AM
Quote from: Cognos_Jan2017 on 22 Apr 2020 09:46:23 AM
Relational Data.

Lineage ...
Field "AAA" in Query1 Datatype ...
National Language Variable Length Character

Field "BBB" in Query2 Datatype ...
Int 32

Both Fields are always in a number format 12345.

We need a Join between Query1 and Query2.

Can we Cast those 2 Fields to new Data Items where a Join would work?

Please let me know if you have any questions.

TIA, Bob

The only way you can use those items in a join is if they have the same overall data type. Normally this is something you'd flag as an issue in your database and fix there (unless the items are from separate data sources, in which case it's an understandable issue).

So yes - cast one or the other of them to an appropriate data type or you won't be able to join successfully.

Cheers!

MF.
Title: Re: Getting a Join to Work by Cast 2 Different Datatypes
Post by: Cognos_Jan2017 on 23 Apr 2020 12:09:30 PM
Thank you MFGF.

I suspected that is the solution.

Will Cast to Integer since it appears all entries (from the Vendor FM design) will always have an Integer appearance.