10 Replies Latest reply on Apr 25, 2018 11:11 AM by Okechukwu Ossai

# Sum of table content=0 ?

Hi community,

I have created a calculate name "COGE MARCH ONLY" which can't be readen by the sum of table :

For exemple : for 2018 i have 3290184 and in the sum of table 0 ??

Have you got a solution ?

kind regards

• ###### 1. Re: Sum of table content=0 ?

Hi Franck,

Looks like the 3,290,184 comes from counting the march sales 3 times (3x1,096,616). Is that what you want to do with that calculation? If all you need are the March sales and return the total, this works:

Hope that helps!

Santiago

1 of 2 people found this helpful
• ###### 2. Re: Sum of table content=0 ?

hi,

no i need this specific calculation ...

if min(DATEPART('month', [DATE]))=3

and min([Filière])="COGE" then window_sum(sum([SALES]),-4,0) else 0

end

thx

• ###### 3. Re: Sum of table content=0 ?

Hi Franck,

It seems you want to sum all the first quarter sales and display that total in the month of March. If that is what you want to do, then this solution will work for you. You can modify the solution to fit whatever use case you may have.

Step 1. Create calculated field called [Total Q1 Sales]

IF DATEPART('month', [DATE]) = 3 AND [Filière] = 'COGE' THEN

{FIXED YEAR([DATE]): SUM({FIXED [DATE], [Filière]: MIN(IF [Filière] = 'COGE' AND DATEPART('month', [DATE]) <= 3 THEN [SALES] ELSE 0 END)})}

ELSE 0 END

Step 2. Create calculated field called [> SALES]

IF [Filière]<> 'COGE' THEN [SALES] ELSE [Total Q1 Sales] END

Step 3. Add the modified [> SALES] to your view and remove [COGE March Only ]

See attached workbook.

Hope this helps.

Ossai

1 of 2 people found this helpful
• ###### 4. Re: Sum of table content=0 ?

Hi, Franck

Please find my solution attached and below screenshot for reference as well.

Hope this helps

ZZ

1 of 1 people found this helpful
• ###### 5. Re: Sum of table content=0 ?

Thanks very much : come back tomorrow for testing this see you bye

• ###### 6. Re: Sum of table content=0 ?

thanks very much  : come back tomorrow for testing see you

• ###### 7. Re: Sum of table content=0 ?

hi

I NEED TH SUM OF TABLE FOR this specific calcul  : "COGE March Only"

this is the result of : november 2018 + december 2018 + january 2019 + february 2019 + march 2019

like the formule :

if min(DATEPART('month', [DATE]))=3

and min([Filière])="COGE" then window_sum(sum([SALES]),-4,0) else 0

end

expect for 2018 because there are note nov 17 dec 17 ... for 2018 it's january 18+feb 2018 + march 2018

thank you

• ###### 8. Re: Sum of table content=0 ?

Hi Franck,

I now understand what you want to do. See my modified solution below.

Step 1. Create calculated field called [COGE March Only Date]

IF DATEPART('month', [DATE]) >= 11 THEN DATEADD('year', 1, [DATE])

ELSEIF DATEPART('month', [DATE]) >= 1 AND DATEPART('month', [DATE]) <= 3 THEN [DATE]

END

Step 2. Create calculated field called [COGE March Only Sales]

IF DATEPART('month', [DATE]) = 3 AND [Filière] = 'COGE' THEN

{FIXED YEAR([COGE March Only Date]): SUM({FIXED [COGE March Only Date], [Filière]: MIN(IF [Filière] = 'COGE' THEN [SALES] ELSE 0 END)})}

ELSE 0 END

Step 3. Create calculated field called [> SALES]

IF [Filière]<> 'COGE' THEN [SALES] ELSE [COGE March Only Sales] END

Step 4. Add the modified [> SALES] to your view and remove [COGE March Only ]

See attached workbook.

Hope this helps.

Ossai

1 of 1 people found this helpful
• ###### 9. Re: Sum of table content=0 ?

thanks a lot that's exactly my need. I have to transpose it on my professional request to test it.

Thanks a lot every body for your help !!