Showing posts with label member. Show all posts
Showing posts with label member. Show all posts

Thursday, March 29, 2012

Copy member data to another member

Hi,

I need to copy all data from one member to another member from the same dimension.

To be more specific, I have a scenario dimension with these members:

->Budget
->Forecast

And I want to start my Forecast with the Budget data from last year * 1.05. Because I will change the values from forecast I can't just put a formula (forecast = budget *1.05, if I do that the cube will always show the formula values and not some new values that I want to enter).

Is there a easy way to do that? Any tip will be great.

Thanks,
Handerson

You should be able to achieve what you are trying to do using SCOPE and FREEZE in the cube MDX script. There are actually some good examples in the Adventure Works cube script. Open the script and do a find on "quota". This will take you to a section in the script where there are several examples that are used to populate a measure called "Sales Amount Quota" in the Adventure Works cube.

HTH,

- Steve

|||

Steve,

I have installed the Adventure Works cube but I can't find the scripts that you sad, where I can find then? I'm using SQL Server 2005.

I looked the Scope and Freeze command, you sugest that I do that:

Forecast01 = Budget * 1.05

Freeze(Forecast01)

After that the users can change de Budget values without change the Forecast, ok. But the users can change the Forecast value using write-back?

And every month I will generate a new Forecast, like this:

Forecast02 = Forecast01

Freeze(Forecast02)

Next month I will do:

Forecast03 = Forecast02

Freeze(Forecast03)

And so on... It'll be performatic? Because of that I was trying to find a way to copy the data instead of build a formule.

Thanks,

Handerson

|||

Handerson,

Here is the script segment that I was referring to. With regard to your question, I thought that you were starting from a base period and then trying to leverage the data that was there into future periods. If you truly need to copy data then you would probably be better off doing this at the source. You can still leverage MDX to show future periods that do not have data using the Scope and Freeze functions. You can also check to see if there is an existing value before you compute a projected value.

/*--

| Sales Quota Allocation |

--*/

/*-- Allocate equally to quarters in H2 FY 2005 */

Scope

(

[Date].[Fiscal Year].&[2005],

[Date].[Fiscal].[Fiscal Quarter].Members,

[Measures].[Sales Amount Quota]

) ;

This = ParallelPeriod

(

[Date].[Fiscal].[Fiscal Year], 1,

[Date].[Fiscal].CurrentMember

) * 1.35 ;

/*-- Allocate equally to months in FY 2002 --*/

Scope

(

[Date].[Fiscal Year].&[2002],

[Date].[Fiscal].[Month].Members

) ;

This = [Date].[Fiscal].CurrentMember.Parent / 3 ;

End Scope ;

/*-- Weighted allocation to remaining months */

// Pin quarterly values prior to assigning weights for months

// This is done in order to avoid overwriting the quarterly values

// once weights are entered for monthly values.

Freeze

(

[Date].[Fiscal].[Fiscal Quarter].Members,

[Measures].[Sales Amount Quota]

) ;

// Scope on month level in FY 2003 and onwards

Scope

(

[Date].[Fiscal Year].&[2003] : Null,

[Date].[Fiscal].[Month].Members

) ;

// Compute weights based on reseller sales ratio in previous year

This =

(

ParallelPeriod // Fetch reseller sales amount in previous year

(

[Date].[Fiscal].[Fiscal Year], 1,

[Date].[Fiscal].CurrentMember

),

[Measures].[Reseller Sales Amount]

)

/

(

ParallelPeriod // Divide monthly value by quarterly value to obtain ratio

(

[Date].[Fiscal].[Fiscal Year], 1,

[Date].[Fiscal].CurrentMember.Parent

),

[Measures].[Reseller Sales Amount]

) ;

// Allocate quarterly values to months according to weight

This = [Measures].CurrentMember * [Date].[Fiscal].Parent ;

End Scope ;

End Scope ;

sqlsql

Tuesday, March 27, 2012

copy from C drive of sql server to another sever!

help!
I'm using a SQL server 2000 box and I'm a member of symins on it and I
have a remote drive mounted on the server that I can copy files to with
Explorer and the command line.
I've created a job that has the following line of SQL in it
xpcmdShell 'copy "C:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\test.txt" "\\madupserver\madeupshare$\testzzzzz.txt"'
and whilst I can make this work in the command line, it tells that my access
is denied...
what can I do to run xpCmdShell with the same priviliges as I have when I'm
running the copy command via the UI of the server
Thanks in advance and regards
CharlesAthis could running as some other user
though i've never encountered this, you could check out who this is
running under using enterprize manager.|||"CharlesA" <CharlesA@.discussions.microsoft.com> wrote in message
news:BCFB6F48-079E-4FFE-A966-22F3B4731A4A@.microsoft.com...
> help!
> I'm using a SQL server 2000 box and I'm a member of symins on it and I
> have a remote drive mounted on the server that I can copy files to with
> Explorer and the command line.
> I've created a job that has the following line of SQL in it
> xpcmdShell 'copy "C:\Program Files\Microsoft SQL
> Server\MSSQL\BACKUP\test.txt" "\\madupserver\madeupshare$\testzzzzz.txt"'
> and whilst I can make this work in the command line, it tells that my
> access
> is denied...
> what can I do to run xpCmdShell with the same priviliges as I have when
> I'm
> running the copy command via the UI of the server
> Thanks in advance and regards
> CharlesA
>
If the SQL Server login running the account is a member of the symins
group, then xp_cmdshell will use the Windows Security account associated
with the MSSQLServer service. If the SQL Server login is not a member of
symins, then xp_cmdshell will run in the context of the SQL Server Agent
Proxy account.
Given your scenario, you need to ensure that the Windows account has the
appropriate privileges on the share.
Rick Sawtell
MCT, MCSD, MCDBA|||Hi Rick,
I'm pretty sure we've had an email dialog before because I remember using
your magnificent book 'TY SQL server 2000 in 21 days' (From SAMS) which got
me into the right thinking mode about SQL server (after years of Access dev
work) I can heartily recommend this work to anyone wishing to understand how
to be a first-time DBA
I hope you're updating it for 2005!
Thanks for you helpful post,
Regards
CharlesAsqlsql

Tuesday, March 20, 2012

Copy Database Wizard

We have member SQL servers in a workgroup, running in a netware environment.
We do not have a domain. The wizard fails when I try to copy a database f
rom one server to another. What's the solution or workaround?
Thank you.Part of the process for the Copy Database Wizard involves the SQL Server
startup account on the destination accessing a mapped drive on the source
machine. If this account cannot access a mapped drive the Copy Database
Wizard will fail.
Rand
This posting is provided "as is" with no warranties and confers no rights.