Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Formula for Cumulative Weighted Mean

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 26, 2016 12:53 PM
(3549 views)

Dear All,

If I have a simple formula as;

ADB=Sum(NetRevenue) / Sum(AdultNight) which is €70.48 = €7,646,735.88 / 108,498 in this data set.

How will I calculate the Cumulative Weighted Mean of ADB (weight=AdultNight) by Sales Date to visualise "ADB Cumulative Mean vs. Sales Date"

The formula I know can not calculate the weight which puts out the wrong final ADB as €68,51

Tables attached

Many thanks in advance for your help.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 27, 2016 7:25 AM
(3593 views)
| Posted in reply to message from saitcopuroglu 02/26/2016 03:53 PM

Does this formula return the numbers you want?

Sum**(**:Name**(**"Sum(NetRevenue)"**)[****1** :: Row**()])** / Sum**(**:Name**(**"Sum(AdultNight)"**)[****1** :: Row**()])**

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 27, 2016 7:25 AM
(3594 views)
| Posted in reply to message from saitcopuroglu 02/26/2016 03:53 PM

Does this formula return the numbers you want?

Sum**(**:Name**(**"Sum(NetRevenue)"**)[****1** :: Row**()])** / Sum**(**:Name**(**"Sum(AdultNight)"**)[****1** :: Row**()])**

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Formula for Cumulative Weighted Mean

Yes it does! Thank you.

Is formula

Sum**(**:Name**(**"Sum(NetRevenue)"**)[****1** :: Row**()])**

a way of calculating the Cumulative Sum?

If I would change the Sum with Mean would it calculate the Cumulative Mean?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Formula for Cumulative Weighted Mean

Feb 28, 2016 11:11 AM
(3436 views)
| Posted in reply to message from saitcopuroglu 02/28/2016 10:15 AM

Yes.

Mean**(**:ADB**[****1**::Row**()])**

should give the same result as your formula

If**(**Row**()** == **1**,

:ADB,

**(**:ADB Cumulative Mean**[**Row**()** - **1****]** * **(**Row**()** - **1****)** + :ADB**)** / Row**()**

**)**

However, for very large tables your formula would probably be significantly faster, despite the conditional structure, because it does not require extracting a matrix for each row.