COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: lmendez818 on 03 Nov 2015 10:17:46 AM

Title: Summing 2 different rows
Post by: lmendez818 on 03 Nov 2015 10:17:46 AM
Hello
I need to be able to perform the following calculations to this data:

1. If Project Type = FIFO and Project Type = KL Phase 1 then agregate the Net Volume for both of them
2.If Project Type = NON FIFO,KL,KL Phase then SUM Net Volume for (Non-FIFO+KL-KL Phase 1)


Project Status   Net Volume
FIFO                  858,250.7
KL                  286,604
KL Phase 1   32,840
Non-FIFO                 67,440.69



I have tried an IF and Case When formula and I keep Getting errors.
I have attached the excel spreadsheet but here is a screen shot of the data as well.

PLEASE HELP!
Lis
Title: Re: Summing 2 different rows
Post by: Francis aka khayman on 03 Nov 2015 07:44:13 PM
are you using dimensional or relational source?
Title: Re: Summing 2 different rows
Post by: lmendez818 on 04 Nov 2015 07:13:05 AM
relational source.
Title: Re: Summing 2 different rows
Post by: Lynn on 04 Nov 2015 07:22:42 AM
Quote from: lmendez818 on 03 Nov 2015 10:17:46 AM
Hello
I need to be able to perform the following calculations to this data:

1. If Project Type = FIFO and Project Type = KL Phase 1 then agregate the Net Volume for both of them
2.If Project Type = NON FIFO,KL,KL Phase then SUM Net Volume for (Non-FIFO+KL-KL Phase 1)


Project Status   Net Volume
FIFO                  858,250.7
KL                  286,604
KL Phase 1   32,840
Non-FIFO                 67,440.69



I have tried an IF and Case When formula and I keep Getting errors.
I have attached the excel spreadsheet but here is a screen shot of the data as well.

PLEASE HELP!
Lis

Why not post up your expressions and the errors you are getting? It would help you get better advice more quickly.

For your first calculation:

case
  when [Project Status] in ('FIFO', 'KL Phase 1' )
        then [Net Volume]
  else 0
end



For your second calculation:

case
  when [Project Status] in ('Non-FIFO', 'KL', 'KL Phase 1' )
        then [Net Volume]
  else 0
end