COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: mrcool on 07 Nov 2005 01:01:57 AM

Title: [Partially Solved]value based on the precision in list report
Post by: mrcool on 07 Nov 2005 01:01:57 AM
Hi frnds,
Ã,  Ã, 
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  I want to get the output in a column based on the precison value in the other column.For example...

Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, For a given metric the value is 250 and the precision is 2 .i need output to display like 250.00.and if the precison is 3 means the output is 250.000.

Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 

thanks,
S

Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 
Title: Re: value based on the precision in list report
Post by: BIsrik on 07 Nov 2005 02:34:53 AM
is the precision dynamic i mean is it enter by the user...

if so, check the round function..

Srik
Title: Re: value based on the precision in list report
Post by: mrcool on 07 Nov 2005 02:51:58 AM
Hi...i want the precision dynamically from the DB....
Title: Re: value based on the precision in list report
Post by: BIsrik on 07 Nov 2005 04:22:14 AM
just drag and drop the column and execute the report and check it..

Srik
Title: Re: value based on the precision in list report
Post by: mrcool on 07 Nov 2005 04:30:35 AM
Ya i tried this alread...but it doesnt work...its just a column named precision in Db..so how it will work when we drag into the report...?How can i relate the precision value with the metric value so that i can get the decimal based on the precision value...



thanks,
S
Title: Re: value based on the precision in list report
Post by: kalyan_sekhar1 on 07 Nov 2005 04:52:15 AM
Hi,

Here is the scenario that mrcool is mentioning. You have acolumn in the List which is populating from a table let say a table which contains two columns

EMPSALARY | PRECISION

25000.00    | 2
352.256      | 3
352.0          | 1
352.4444    | 4
352             | 0


As u see from the abve table the EMPSALARY precision is based on the PRECISION column, so how do we achive this in the List report, how do we put conditional relation so that these two automatically tied up to display the data basing on the preicion

Thanks
Title: Re: value based on the precision in list report
Post by: BIsrik on 07 Nov 2005 05:15:34 AM
its strange that the precision of the column itself is not fixed..rather the values in it are fixed..

try using this function..

round(empsalary, precision)

srik
Title: Re: value based on the precision in list report
Post by: kalyan_sekhar1 on 07 Nov 2005 05:20:25 AM
Thats nice,

Just now we tried this, only problem with this is let say if there is a numeric value like 389 and the precision for that is 2, but still i am getting the value as 389, but my intension is to get the value as 389.00

How do i do tht ?

Thanks
Title: Re: value based on the precision in list report
Post by: mrcool on 07 Nov 2005 05:31:53 AM
Thnx kalyan what u said is correct....hi srik can u tell the sol for that.... ;)


Thanks,
S
Title: Re: value based on the precision in list report
Post by: mrcool on 07 Nov 2005 11:47:04 PM
Hi srik any idea abt the problem...waiting 4 ur reply...
Title: Re: value based on the precision in list report
Post by: BIsrik on 08 Nov 2005 02:51:34 AM
round function is useful when u have decimal values and u want to round them to some precision. But if there r no decimal values then it does nothing..Even if the round value number is more than the number of decimal digits it won't add any zeros after that...

For Eg: round(330.123,4) would output as 330.123 and not 330.1230. This is how round function works..

Now if u want the zeros to be added then i feel u have to some other functions than round...

Well anyway i too shall check the easiest way out for this...

Srik
Title: Re: value based on the precision in list report
Post by: mrcool on 08 Nov 2005 03:36:11 AM
Thank u...Hope u will find the sol...