COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: aamuktha on 22 Dec 2005 01:34:02 AM

Title: [Solved]Dynamically Thousand Seperator
Post by: aamuktha on 22 Dec 2005 01:34:02 AM
Hi friends,

here is the issue,

Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  In my report i need to display thousand seperator according some conditon.
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, for example : if active_flag ='Y' then value should display with thousand seperator else it should not display the thousand seperator.
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  value =25000
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if yes it should display the value as in the report 25,000
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if no it should didplay the value as in the report 25000
i tried with conditional style option but it doesn't worked for me.
can anybody suggest me how to solve this problem

thanks
aamuktha
Title: Re: Dynamically Thousand Seperator
Post by: BIsrik on 22 Dec 2005 05:42:36 AM
it could be done by the conditional style itself..have u checked on the data format part...

Srik
Title: Re: Dynamically Thousand Seperator
Post by: bdybldr on 22 Dec 2005 07:28:23 AM
Srik,
The data format property is not available for conditional style.
Title: Re: Dynamically Thousand Seperator
Post by: BIsrik on 23 Dec 2005 12:33:06 AM
ok, i was not clear with my saying..

I meant this way..drag the measure column twice to the report. For one column apply the data format setting saying display thousand separator and for another set it to no. Then in conditional formating depending on the condition set the column box type to none.

Srik
Title: Re: Dynamically Thousand Seperator
Post by: aamuktha on 23 Dec 2005 04:19:11 AM
hi

thanks  for ur reply
but that is not my issue
i have a list report in that few rows are related to active_flag='y' and few rows are related to active _flag='n' .In this case the solution given by u doesn't work.

format of the report:

name              active_flag               value1                           value2
aaaa                  y                            2,000                            3,000
bbbb                  n                            2000                             3000


this is the way i need to show the output in the report   

aamuktha           
Title: Re: Dynamically Thousand Seperator
Post by: BIsrik on 23 Dec 2005 05:49:31 AM
u can have the same solution for this...

I went with this approach, first selected name, active_flag and value1 and value2 into the list. Then inserted value 1 and value2 again in the list. Then i set the data format property for the one set of value1 and value2. Then created a variable saying active_flag = 'Y'. then depending on the condition i set the box type propery to none..

I don't have the standard cognos package with me or else could have given u a xml spec.

Srik
Title: Re: Dynamically Thousand Seperator
Post by: bdybldr on 23 Dec 2005 07:29:32 AM
That should definately work.  Good solution, Srik.
Title: Re: Dynamically Thousand Seperator
Post by: Boris-A on 25 Dec 2005 01:12:19 PM
You can conditional format  the "data format" if you unlock objects.  This is a bit of a pain in the a.. but it works.  You unlock your page, then you can select the data item itself and make your conditional formatting.  No need to complexify more than that, no need for two columns, etc.

Cheers
Title: Re: Dynamically Thousand Seperator
Post by: sridhar_world on 29 Dec 2005 01:55:10 AM
Hi,

We have assumed a 9 digit number (123456789) and formatted it as a comma separated value.

Below is the calculation which we used.

We have tested it on DB2 database. You might have to change some of the functions if u r using any other database.

Let us know if this was of any help to you.

Calculation:




trim(LEADING, ',', cast(

(substring((trim(char(repeat(',',(9-length('123456789'))))) + '123456789'), 1, 3) + ',' +

substring((trim(char(repeat(',',(9-length('123456789'))))) + '123456789'), 4, 3) + ',' +

substring((trim(char(repeat(',',(9-length('123456789'))))) + '123456789'), 7, 3)),

CHAR(11)) )



Regards,
Sri

Title: Re: Dynamically Thousand Seperator
Post by: BIsrik on 29 Dec 2005 05:05:48 AM
gr8 Boris, A very simple solution indeed.

Sridhar, How would that calculation help in conditional formatting..

Srik
Title: Re: Dynamically Thousand Seperator
Post by: sridhar_world on 30 Dec 2005 12:18:11 AM
I just gave a way of inserting commas with the help of a calculation.

This calculation should be done when the flag is Y, else just convert the number to String and leave it. that way, it would work.

But, solution given by Boris is simple and efficient. I made it unnecessarily complex, not knowing about unlocking and then applying conditional formatting.

Regards,
Sri
Title: Re: Dynamically Thousand Seperator
Post by: BIsrik on 30 Dec 2005 01:23:56 AM
fine...

aamuktha, could u plz update us the status of the topic...

Srik
Title: Re: Dynamically Thousand Seperator
Post by: bdybldr on 03 Jan 2006 08:27:25 AM
aamuktha,
Please close this thread if your issue is solved.  See the board rules.