COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Manu0521 on 30 Mar 2014 12:30:40 PM

Title: % calculation for more than one member set
Post by: Manu0521 on 30 Mar 2014 12:30:40 PM
Sales                 A   B   C   D    P1(A+B+C+D)   A1   B1   C1   D1   P2(A1+B1+C1+D1)
Customer1   25   25   25   25   100                  40   10   40   10   100
Customer2   25   25   25   25   100                  25   25   25   25   100


Expected:
Sales            A       B      C     D     P1(A+B+C+D)     A1  B1  C1  D1   P2(A1+B1+C1+D1)     

Customer1   25% 25% 25% 25% 100%               40% 10% 40% 10% 100%
Customer2   25% 25% 25% 25% 100%               25% 25% 25% 25% 100%     
                             
                             
I wanted to show % of total for each product p1,p2                             
Iam using a calculated measure and my expression would be Sales/total(Sales with in set)                             
Here I have two sets one for product 1 -P1 and other for product2 -P2.                             
How will my expression be.                             
I have children(p1) as a member set and children(p2) as amember set in my query
How should I expression in my measure be...sales/ total(sales within set ????) allows only one set.

Any help is appreciated.
Thanks,
Title: Re: % calculation for more than one member set
Post by: CognosPaul on 30 Mar 2014 12:37:20 PM
It's a little hard to tell from your example what I'm seeing. Are the (A,B,C,D) set and the (A1,B1,C1,D1) set from the same hierarchy? Are P1 and P2 siblings?
Title: Re: % calculation for more than one member set
Post by: Manu0521 on 30 Mar 2014 09:07:42 PM
Yes. Two different sets from same hierarchy and my columns will have set 1 and set 2 and I should show the percentage total of the customer with respect to each set .
Title: Re: % calculation for more than one member set
Post by: Manu0521 on 30 Mar 2014 09:13:17 PM
P1 is the total of a,b,c,d and p2 is the total of a1,b1,c1,d1..p1and p2 are parents .I want to show the percentage of sales with respect to p1 for a,b,c,d and percentage of sales with respect to p2 for a1,b1,c1,d1...
Title: Re: % calculation for more than one member set
Post by: Francis aka khayman on 30 Mar 2014 10:28:36 PM
seems pretty straightforward... have you tried to start creating the report? what have you got so far? and where are you encountering a problem?
Title: Re: % calculation for more than one member set
Post by: Manu0521 on 31 Mar 2014 06:22:01 AM
Sales/total(sales with in set p1) allows me to give only one set...how to get the percentage with respect to p2..
Title: Re: % calculation for more than one member set
Post by: Manu0521 on 31 Mar 2014 02:02:17 PM
This worked.
Thanks Paul.
[Sales]/tuple([Sales],parent(currentMember(product Hierarchy)))