COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: bonfire09 on 10 Mar 2018 01:16:58 PM

Title: Subquerying using a Calculated Field
Post by: bonfire09 on 10 Mar 2018 01:16:58 PM
I am trying to create a subquery in Cognos that checks if the value of one column exists in another column in another query. I have one query with accounts and another query that shows if the account can be accessed online and I've join both queries. I want to create a calculated column that basically binary codes 1 for accounting having online connection and 0 not. I have tried

case when [acctno] in ([online_account]) then 1 else 0 end. But its showing a parsing error.  Any help would be great. Thanks!
Title: Re: Subquerying using a Calculated Field
Post by: Pratap Reddy on 13 Mar 2018 04:47:31 AM
Quote from: bonfire09 on 10 Mar 2018 01:16:58 PM
I am trying to create a subquery in Cognos that checks if the value of one column exists in another column in another query. I have one query with accounts and another query that shows if the account can be accessed online and I've join both queries. I want to create a calculated column that basically binary codes 1 for accounting having online connection and 0 not. I have tried

case when [acctno] in ([online_account]) then 1 else 0 end. But its showing a parsing error.  Any help would be great. Thanks!

case
when [Product line] = [Product line1]
then 1
else
0
end

Regards,
Pratap
Title: Re: Subquerying using a Calculated Field
Post by: MFGF on 13 Mar 2018 05:24:52 AM
Quote from: bonfire09 on 10 Mar 2018 01:16:58 PM
I am trying to create a subquery in Cognos that checks if the value of one column exists in another column in another query. I have one query with accounts and another query that shows if the account can be accessed online and I've join both queries. I want to create a calculated column that basically binary codes 1 for accounting having online connection and 0 not. I have tried

case when [acctno] in ([online_account]) then 1 else 0 end. But its showing a parsing error.  Any help would be great. Thanks!

Hi,

What is the error you are seeing?

MF.