dbTalk Databases Forums  

Percentage analysis

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Percentage analysis in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
BizWorld
 
Posts: n/a

Default Percentage analysis - 11-13-2005 , 07:55 PM






Hi,

I want to show Percentage analysis on basis of # of passengers per City.
I have the Detail data with pessenger information travelling in Tri rail per
City.

Now if i create a measure then i have only option to Sum or Count the
records while i want to have a percentage.

I dont know how i can do it in Cube.....any idea

Regards,

BizWorld



Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Percentage analysis - 11-13-2005 , 09:46 PM






You would create a calculated measure with a formula something like the
one in the formula below. The sample below works with the Foodmart 2000
database and takes the currently selected customer and returns the
percentage against the "All Customers" member.

Quote:
WITH
MEMBER Measures.Pcnt as '[Measures].[Sales Count]/(measures.[Sales
Count],[Customers].[All Customers]) * 100'
SELECT
{Measures.[Sales Count], Measures.Pcnt} ON COLUMNS,
{[Customers].[All Customers],[Customers].[City].Members} ON ROWS
FROM Sales
Quote:
In your case you should be able to create a calculated measure in your
cube that looks something like this "[Measures].[Passenger Count]/
(measures.[Passenger Count],[Locations].[All Locations]) * 100" assuming
that your measure is called "Passenger Count" and your cities are stored
in a dimension called "Locations".

HTH

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <eLIDz5L6FHA.1000 (AT) tk2msftngp13 (DOT) phx.gbl>,
moonis.tahir (AT) gmail (DOT) com says...
Quote:
Hi,

I want to show Percentage analysis on basis of # of passengers per City.
I have the Detail data with pessenger information travelling in Tri rail per
City.

Now if i create a measure then i have only option to Sum or Count the
records while i want to have a percentage.

I dont know how i can do it in Cube.....any idea

Regards,

BizWorld





Reply With Quote
  #3  
Old   
BizWorld
 
Posts: n/a

Default Re: Percentage analysis - 11-15-2005 , 09:46 AM



I am using this Syntax on one of my Cube. But it says Syntax error. any idea
what i wrote wrong.





WITH

MEMBER Measures.Pcnt as

'[Measures].[Total On Time]/(measures.[Totals],[TradeLane].[All TradeLane])
* 100'

SELECT

{measures.[Total On Time], Measures.Pcnt} ON COLUMNS,

{[TradeLane].[All TradeLane],[TradeLane].[Port].Members} ON ROWS

FROM OnTimePerformance





"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote

Quote:
You would create a calculated measure with a formula something like the
one in the formula below. The sample below works with the Foodmart 2000
database and takes the currently selected customer and returns the
percentage against the "All Customers" member.


WITH
MEMBER Measures.Pcnt as '[Measures].[Sales Count]/(measures.[Sales
Count],[Customers].[All Customers]) * 100'
SELECT
{Measures.[Sales Count], Measures.Pcnt} ON COLUMNS,
{[Customers].[All Customers],[Customers].[City].Members} ON ROWS
FROM Sales


In your case you should be able to create a calculated measure in your
cube that looks something like this "[Measures].[Passenger Count]/
(measures.[Passenger Count],[Locations].[All Locations]) * 100" assuming
that your measure is called "Passenger Count" and your cities are stored
in a dimension called "Locations".

HTH

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <eLIDz5L6FHA.1000 (AT) tk2msftngp13 (DOT) phx.gbl>,
moonis.tahir (AT) gmail (DOT) com says...
Hi,

I want to show Percentage analysis on basis of # of passengers per City.
I have the Detail data with pessenger information travelling in Tri rail
per
City.

Now if i create a measure then i have only option to Sum or Count the
records while i want to have a percentage.

I dont know how i can do it in Cube.....any idea

Regards,

BizWorld







Reply With Quote
  #4  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Percentage analysis - 11-15-2005 , 04:23 PM



Hard to say, does the error give you an more info? Or is it just a
generic "Syntax Error"?

One thing that I don't understand is that you are referring to a measure
called [Totals] after the division sign. I would have thought this
should have been using the [Total On Time] measure.

eg

Quote:
WITH

MEMBER Measures.Pcnt as

'[Measures].[Total On Time]/(measures.[Total On Time],[TradeLane].[All
TradeLane])
* 100'

SELECT

{measures.[Total On Time], Measures.Pcnt} ON COLUMNS,

{[TradeLane].[All TradeLane],[TradeLane].[Port].Members} ON ROWS

FROM OnTimePerformance

Quote:
One other thing. It is hard to tell with the wrapping on these newsgroup
posts and you are probably already doing this, but the formula should
all be on one line.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <O3z4yuf6FHA.572 (AT) TK2MSFTNGP15 (DOT) phx.gbl>,
moonis.tahir (AT) gmail (DOT) com says...
Quote:
I am using this Syntax on one of my Cube. But it says Syntax error. any idea
what i wrote wrong.





WITH

MEMBER Measures.Pcnt as

'[Measures].[Total On Time]/(measures.[Totals],[TradeLane].[All TradeLane])
* 100'

SELECT

{measures.[Total On Time], Measures.Pcnt} ON COLUMNS,

{[TradeLane].[All TradeLane],[TradeLane].[Port].Members} ON ROWS

FROM OnTimePerformance





"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote in message
news:MPG.1de2b39574d5e28f9897b5 (AT) news (DOT) microsoft.com...
You would create a calculated measure with a formula something like the
one in the formula below. The sample below works with the Foodmart 2000
database and takes the currently selected customer and returns the
percentage against the "All Customers" member.


WITH
MEMBER Measures.Pcnt as '[Measures].[Sales Count]/(measures.[Sales
Count],[Customers].[All Customers]) * 100'
SELECT
{Measures.[Sales Count], Measures.Pcnt} ON COLUMNS,
{[Customers].[All Customers],[Customers].[City].Members} ON ROWS
FROM Sales


In your case you should be able to create a calculated measure in your
cube that looks something like this "[Measures].[Passenger Count]/
(measures.[Passenger Count],[Locations].[All Locations]) * 100" assuming
that your measure is called "Passenger Count" and your cities are stored
in a dimension called "Locations".

HTH


Reply With Quote
  #5  
Old   
BizWorld
 
Posts: n/a

Default Re: Percentage analysis - 11-15-2005 , 08:20 PM



i simply used now following expression which resolved the issue

( [Measures].[Total On Time]/[Measures].[Totals] ) * 100

i wrote this expression in Caclulated Member,.....so i can see percentage
now......

i beleive i can use the same expression in Analysis Service 2005........

Regards,

BizWorld


"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote

Quote:
Hard to say, does the error give you an more info? Or is it just a
generic "Syntax Error"?

One thing that I don't understand is that you are referring to a measure
called [Totals] after the division sign. I would have thought this
should have been using the [Total On Time] measure.

eg



WITH

MEMBER Measures.Pcnt as

'[Measures].[Total On Time]/(measures.[Total On Time],[TradeLane].[All
TradeLane])
* 100'

SELECT

{measures.[Total On Time], Measures.Pcnt} ON COLUMNS,

{[TradeLane].[All TradeLane],[TradeLane].[Port].Members} ON ROWS

FROM OnTimePerformance



One other thing. It is hard to tell with the wrapping on these newsgroup
posts and you are probably already doing this, but the formula should
all be on one line.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <O3z4yuf6FHA.572 (AT) TK2MSFTNGP15 (DOT) phx.gbl>,
moonis.tahir (AT) gmail (DOT) com says...
I am using this Syntax on one of my Cube. But it says Syntax error. any
idea
what i wrote wrong.





WITH

MEMBER Measures.Pcnt as

'[Measures].[Total On Time]/(measures.[Totals],[TradeLane].[All
TradeLane])
* 100'

SELECT

{measures.[Total On Time], Measures.Pcnt} ON COLUMNS,

{[TradeLane].[All TradeLane],[TradeLane].[Port].Members} ON ROWS

FROM OnTimePerformance





"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote in message
news:MPG.1de2b39574d5e28f9897b5 (AT) news (DOT) microsoft.com...
You would create a calculated measure with a formula something like the
one in the formula below. The sample below works with the Foodmart 2000
database and takes the currently selected customer and returns the
percentage against the "All Customers" member.


WITH
MEMBER Measures.Pcnt as '[Measures].[Sales Count]/(measures.[Sales
Count],[Customers].[All Customers]) * 100'
SELECT
{Measures.[Sales Count], Measures.Pcnt} ON COLUMNS,
{[Customers].[All Customers],[Customers].[City].Members} ON ROWS
FROM Sales


In your case you should be able to create a calculated measure in your
cube that looks something like this "[Measures].[Passenger Count]/
(measures.[Passenger Count],[Locations].[All Locations]) * 100"
assuming
that your measure is called "Passenger Count" and your cities are
stored
in a dimension called "Locations".

HTH




Reply With Quote
  #6  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Percentage analysis - 11-15-2005 , 08:21 PM



In article <O8A98Ql6FHA.3636 (AT) TK2MSFTNGP12 (DOT) phx.gbl>,
moonis.tahir (AT) gmail (DOT) com says...
Quote:
i beleive i can use the same expression in Analysis Service 2005........

Yes, this should work fine in AS2k5.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.