16 Replies Latest reply: Apr 25, 2017 8:12 AM by kiran ch

# Problems with sum

Hi

i have a data set of production that i am doing some calculation and i need to show the sum by month

here is the data sample:

 PRD DATE PRODPOOL ITEMID QTYSCHED QTYGOOD TIME NORMALIZATION TIME/NORMALIZATION PRD00067352 01/01/2017 20 5D26-02GNPC-001 2 2 30 5 6 PRD00067356 01/01/2017 20 5D26-02GNPC-001 1 1 30 5 6 PRD00068496 01/01/2017 20 5CR3000000-01BTXH-01 95 95 15 5 3 PRD00070965 02/01/2017 20 5D26-04A1XH-001 30 30 60 5 12 PRD00070968 01/01/2017 20 5D26-04A1XF-001 40 40 60 5 12 PRD00071041 02/01/2017 32 5RP500-34BTN5-006 200 200 15 0.67 22.39 PRD00071183 01/01/2017 20 5CR2000000-06G0NB-01 5 5 15 5 3 PRD00071185 02/01/2017 32 5RP500-34BTN5-006 200 200 15 0.67 22.39 PRD00071338 02/01/2017 20 5CR3000000-10R0XH-01 4 4 15 5 3 PRD00072524 02/01/2017 20 5NR4020NS-02NTPR-002 50 50 5 5 1 PRD00072829 01/01/2017 10 0252-050002NR-FG 200 117 5 0 5 PRD00073205 02/01/2017 20 0242-2606PC-FF 120 36 5 5 1 PRD00073299 01/01/2017 20 5D26NS-06R2XH-001 2 2 60 5 12 PRD00073494 01/01/2017 20 5VB60-12N1XI-004 1 1 0 5 0

when i try to get the sum of prodpool by month i cant seem to get it when i remove the PRD from the table

DATE by MONTH PRODPOOL QTYSCHED QTYSCHED*TIME/NORMALIZATION JAN 2017 20 14,630 27,089 JAN 2017 30 31,215 49,977 JAN 2017 32 7,671 48,764

can someone help?

• ###### Re: Problems with sum

Hi,

For straight table, Take Date as Dimension and sum(PRODPOOL) as expression ( you can add more expression like sum(QTYSCHED), etc). You can change the date format.

You can remove the grand total from expression tab, goto Total mode and check No total for each expression.

 DATE PRODPOOL QTYSCHED 294 950 1/1/2017 150 346 2/1/2017 144 604
• ###### Re: Problems with sum

i do the calculation for each line of PRD

i take the QTYSCHED*TIME/NORMALIZATION

I want the total to be the total for each month and for each prodpool

• ###### Re: Problems with sum

What's your question?

What is wrong?

What is your current output? And what do you expect to have?

• ###### Re: Problems with sum

when i do a table that has the field PRD i get the calculation for each PRD and also the sum

when i try to get a table that sums the total QTYSCHED*TIME/NORMALIZATION with for each month i cant get the total sum.

i removed the PRD from that table so i can get the total but than for some reason it does not work.

• ###### Re: Problems with sum

im trying to get this:

DATE by MONTH PRODPOOL QTYSCHED QTYSCHED*TIME/NORMALIZATION JAN 2017 20 14,630 27,089 JAN 2017 30 31,215 49,977 JAN 2017 32 7,671 48,764
• ###### Re: Problems with sum

Like this?

• ###### Re: Problems with sum

for some reason it does not work in the qvf

check the attached file

• ###### Re: Problems with sum

Maybe you've written

(QTYSCHED*TIME)/NORMALIZATION

instead of :

(Sum(QTYSCHED)*sum(TIME))/sum(NORMALIZATION)

?

• ###### Re: Problems with sum

i need the calculation for each row of PRD and then to sum all the results

• ###### Re: Problems with sum

Use

(Sum(QTYSCHED)*sum(TIME))/sum(NORMALIZATION)

and see what happens

• ###### Re: Problems with sum

Can you give your qvf file or explain in detail whats your expected

• ###### Re: Problems with sum

attached the qvf

• ###### Re: Problems with sum

HI,

Sum of Normalization is zero  for Prod Pool 10 and any thing divide by zero is undefined.

Regards,

Nandkishor Pandirkar

• ###### Re: Problems with sum

maybe for a single line but not all of them

• ###### Re: Problems with sum

May be you can write a if condition if Normalization is 0 then the expression is 0