COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: inu on 03 Mar 2014 04:59:00 AM

Title: How to restrict the rows having zero values
Post by: inu on 03 Mar 2014 04:59:00 AM
HI
I have amount_sold item in my report , i want to display the amount_sold only which is not null, if null then dont display the record. how to write the logic . please specify the steps to be followed.

Thanks and Regards
Inam
Title: Re: How to restrict the rows having zero values
Post by: BigChris on 03 Mar 2014 05:38:49 AM
Assuming you do mean null, then you need a detail filter that looks something like:

amount_sold is not missing

Title: Re: How to restrict the rows having zero values
Post by: inu on 03 Mar 2014 06:23:58 AM
Hi
Thank you for your given time, but i didnot get u, can u please explain it , what steps i have to take.
1) Should i take another query calculation. or i have to modify the expression of amount_sold.
2)What function and logic should be used to reach to desired solution

Please i m not as much master in report studio.

Thank u
Inam
Title: Re: How to restrict the rows having zero values
Post by: BigChris on 03 Mar 2014 06:45:03 AM
Hi,

No, you don't need to do anything to the query calculation - you just need to drag your field into the detail filter section (top right in your query design) and add is not missing to the end of it.

C
Title: Re: How to restrict the rows having zero values
Post by: tequila on 03 Mar 2014 06:56:31 AM
How about this (looking at screenshot) ?

Dataformat - Number (Zahl) - Nullcharakter (Nullwertzeichen) and press 1x spacebar (empty)

also the result is when amount_sold output 0 it show empty.

Hope it is a right solution for you.
Title: Re: How to restrict the rows having zero values
Post by: Francis aka khayman on 03 Mar 2014 08:01:41 AM
suppress the null values.... if you need the steps how, google it.
Title: Re: How to restrict the rows having zero values
Post by: bdbits on 03 Mar 2014 10:48:02 AM
Built-in null suppression is under the Data menu in Report Studio. If that does not work for you for whatever reason, then it matters whether you are using a relational or a dimensional (cube, DMR) source.

For relational, you should use the detail filter as suggested.

For dimensional, I would apply a filter() to an edge data item (assuming crosstab). e.g. filter([Cube].[Hierarchy].[Level1].[Level2],[amount_sold] is not null). There might be better ways as I am not the most proficient report developer, but this does work for me.

Whatever you do, never, ever use a detail filter on a dimensional data source. CognosPaul is the spokesperson as to why. :D You can read one of his great explanations at http://www.cognoise.com/index.php/topic,18290.5.html (http://www.cognoise.com/index.php/topic,18290.5.html).