COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: thart21 on 27 Feb 2013 09:27:17 AM

Title: Expression using "total,for and "between
Post by: thart21 on 27 Feb 2013 09:27:17 AM
Hi,

I'm trying to get an expression to work in Report Studio 10.1.1 but it is giving me only 0 and 1 for results in the column.

total([Presentation Layer].[Sales Order Delivery].[DC Shpd Qty] for [Presentation Layer].[Sales Order].[SO Doc Hdr Nbr]) between 1 and 9

What I am trying to get is
Add up the DC Shpd Qty for each SO Doc Hdr Nbr where DC Shpd Qty is between 1 and 9

Any ideas as to how I should do this would be appreciated.

Thanks,

Toni
Title: Re: Expression using "total,for and "between
Post by: blom0344 on 28 Feb 2013 02:47:58 PM
case when
[Presentation Layer].[Sales Order].[SO Doc Hdr Nbr] between 1 and 9
then
total([Presentation Layer].[Sales Order Delivery].[DC Shpd Qty] for [Presentation Layer].[Sales Order].[SO Doc Hdr Nbr])
else 0 end