Page 1 of 1

SwapAliasWithPrincipalName

Posted: Mon Aug 01, 2016 10:32 pm
by PavoGa
Have run into a brick wall with this:

I have a dimension that has two elements that I want to swap the data between. Thought maybe using SwapAliasWithPrincipalName would do the trick and it does...until the server is restarted and the dimension elements appear to return to their original, un-swapped state. Before swap:

ElemX $1000
ElemY $1100

After using SwapAliasWithPrincipalName twice (change each to some intermediary name and then to their final designation) I have:

ElemY $1000
ElemX $1100

When the server restarts, it goes back to the original, pre-swap display. Have tried a number of things, including doing the swap, creating a copy of the dimension with a TI, using the copy to update the original dimension, or trying to substitute the dimension copy when server is down then restarting the server. In both these cases I wind up with:

ElemX $1000 and ElemY has lost its data.

Has anyone had to do anything like this and done it successfully? It appears this cannot be done without using a TI or TI's to move the data around.

Re: SwapAliasWithPrincipalName

Posted: Tue Aug 02, 2016 3:26 am
by BariAbdul
SwapAliasWithPrincipalName is known to have some issues and wouldn't be trusted fully. Couldn't you export the data and do the necessary changes and import it back.Of course data backup is mandatory.It far more reliable and easier.Thanks.

Re: SwapAliasWithPrincipalName

Posted: Tue Aug 02, 2016 7:04 am
by gtonkin
One trick to remember is to always dirty the cube(s) you impact i.e. if you swap a measure, make sure you change a value in each cube that dimension is used in, then save data.

Re: SwapAliasWithPrincipalName

Posted: Tue Aug 02, 2016 12:23 pm
by PavoGa
SwapAliasWithPrincipalName is known to have some issues and wouldn't be trusted fully. Couldn't you export the data and do the necessary changes and import it back.Of course data backup is mandatory.It far more reliable and easier.Thanks.
Yes, but this dimension affects a lot of cubes, so that is the last resort.
One trick to remember is to always dirty the cube(s) you impact i.e. if you swap a measure, make sure you change a value in each cube that dimension is used in, then save data.
Interesting! I will try that this morning and report the result.

Re: SwapAliasWithPrincipalName

Posted: Tue Aug 02, 2016 12:45 pm
by tomok
PavoGa wrote:
One trick to remember is to always dirty the cube(s) you impact i.e. if you swap a measure, make sure you change a value in each cube that dimension is used in, then save data.
Interesting! I will try that this morning and report the result.
It's not really a trick but rather a requirement. In order to trigger a cube save you have to change an actual value in the cube. Just changing a dimension in the cube, even if it may mean some elements go away, or new ones added, will not trigger a save. You will still be left with the same .cub file.

Re: SwapAliasWithPrincipalName

Posted: Tue Aug 02, 2016 2:22 pm
by bmrizzuti
What I would do is use a third "Dummy" Attribute to do the swapping.

So we have attribute A, attribute B, and our Dummy attribute C.

So the Operation would be

A-->C
B-->A
C-->B

Blank or zero "C".

EDIT: In case you just want to swap data is the same operation.

Re: SwapAliasWithPrincipalName

Posted: Tue Aug 02, 2016 4:29 pm
by PavoGa
One trick to remember is to always dirty the cube(s) you impact i.e. if you swap a measure, make sure you change a value in each cube that dimension is used in, then save data.
Performed the following steps:

1) Swapped the ElemX and ElemY with ElemXa and ElemYa aliases.
2) Dirtied the cube, changing some data in both ElemXa and ElemYa.
3) Cycled the server. So far so good, ElemXa and ElemYa had the expected data.
4) Changed the aliases for ElemXa and ElemYa to ElemY and ElemX respectively.
5) Swapped the aliases and ElemY and ElemX now hold the data originally in ElemX and ElemY respectively.
6) Dirtied the cube again for both elements.
7) Cycled the server.
8) Opened the cube and the data was back in its original ElemX and ElemY cells. :?