COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: katdbc on 28 Sep 2010 10:52:42 PM

Title: question regarding filtering !!!basic sql~~~
Post by: katdbc on 28 Sep 2010 10:52:42 PM
i have a doubt in report studio !!!!

i have a column called account_num  its values start with tc !!!
i want to remove the tc and want the account number which starts with 500
how do i do it easily!!!
i first used a substring and then again used a substring(substring(),,,,)=500

i donno whats rong!!!can u guys correct me here on what will work on report studio!!!!

my answer is substr(substr([account_num],3,10),1,3)=500

Title: Re: question regarding filtering !!!basic sql~~~
Post by: technomorph on 29 Sep 2010 03:04:12 AM
If I've interpreted what you want correctly....

Create a column ([My_Data_Item]) with the following:
substr([account_num],3,10)

Create a filter:
substr([My_Data_Item],1,3) = 500


Title: Re: question regarding filtering !!!basic sql~~~
Post by: Gopinath on 29 Sep 2010 04:53:25 AM
I hope the simplest way is creating a filter like
substr([account_num],3,3) = '500'
Title: Re: question regarding filtering !!!basic sql~~~
Post by: katdbc on 29 Sep 2010 08:43:41 AM
Thank you for your replies!!!!!!!
it did work!!!!!

is anything wrong with the report studio,some times a query doesn work and if i open the same query next day,it runs fine!!!!!
what would be the best suggestion from ur experince!!i have just started with the report studio!!!!!so plz bare my questions!!!!!!
Title: Re: question regarding filtering !!!basic sql~~~
Post by: cognostechie on 29 Sep 2010 01:56:54 PM
From my experience, I have noticed that Report Studio is moody. The queries particularly run fine during the 1st part of the day and it starts acting up after 3 pm or so. The dispatchers become tired from continuous calls being made to them since early morning. Like all of us, it also needs a rest of 8 hrs during the night. That might be the reason why your query worked the next day !

Seriously..sometimes WE become tired and can't figure out what's wrong and the next day, our minds work better !