bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

Update }bedrock.cube.data.copy.pro

Open wimgielis opened this issue 1 year ago • 5 comments

2 major changes:

  • pCumulate works on strings too
  • for string cells, a prefix and/or suffix can be provided

wimgielis avatar Aug 15 '24 12:08 wimgielis

Hi Wim, what is the use case of prefix and/or suffix? In what situations do you fin that useful (just curious)? I think there should also be specified the delimiter to use when doing the concatenation of the strings - currently there is | ' ' | being used. Would it make sense to add something like pStringCumulateDelimiter = ' '?

tomasfelcman avatar Aug 15 '24 19:08 tomasfelcman

Hello Tomas,

When you migrate a customer from on premise to the cloud, the customer often has CAMID security groups. If the customer has CAoC, they continue to work. If the customer does not, we have a problem. All such groups need to be renamed.

You copy over the }Groups dimension as well as all security related control cubes.

Swapping with an alias does not work on that }Groups dimension and corrupts the TM1 model. You should not that. Then, an alternative is to loop over the CAMID groups and create a new security group for each existing CAMID group. For instance, the new group name is the old group name except the namespace. Then you loop over all the security control cubes and use Bedrock to copy over the fixed cell values from the source groups to the new target groups.

For the }ElementAttributes_}Groups cube, where you can have aliases, this will be an issue. The new group cannot have the same alias value as the old security group. Therefore, if we add a prefix or suffix to make it unique, we are good. After that, you can remove the old security groups, the alias value becomes available and you can adjust the alias value on the new security groups to be again the alias value from the old group.

I have been doing this exercise now 3 times and it's time consuming if you don't automate it.

Long story, hope it's clear :-)

I can imagine other use cases as well. Granted, not thousands :-) Copying values from 1 measure to another with a prefix or suffix to avoid a useless rule or yet another TI to write ourselves.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 21:31 schreef tomasfelcman @.***>:

Hi Wim, what is the use case of prefix and/or suffix? In what situations do you fin that useful (just curious)? I think there should also be specified the delimiter to use when doing the concatenation of the strings - currently there is | ' ' | being used. Would it make sense to add something like pStringCumulateDelimiter = ' '?

— Reply to this email directly, view it on GitHub https://github.com/cubewise-code/bedrock/pull/414#issuecomment-2292048425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDHULJZF2JYGEIAOFMME6TZRT6XRAVCNFSM6AAAAABMSEUVFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGA2DQNBSGU . You are receiving this because you authored the thread.Message ID: @.***>

wimgielis avatar Aug 15 '24 20:08 wimgielis

Well, a delimiter would be good too. It would be an easy fix in the TI process. Not sure how useful it would be but it also does not cost a lot to implement.

If we get really wild we could use Expand() too. Something like:

%newvalue% (%oldvalue%)

Such that the old value is between brackets, after the new value.

Probably overkill to implement but let's see what feedback others post. A delimiter like a dash would already be a good simple option too, besides my space.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 22:02 schreef Wim Gielis @.***>:

Hello Tomas,

When you migrate a customer from on premise to the cloud, the customer often has CAMID security groups. If the customer has CAoC, they continue to work. If the customer does not, we have a problem. All such groups need to be renamed.

You copy over the }Groups dimension as well as all security related control cubes.

Swapping with an alias does not work on that }Groups dimension and corrupts the TM1 model. You should not that. Then, an alternative is to loop over the CAMID groups and create a new security group for each existing CAMID group. For instance, the new group name is the old group name except the namespace. Then you loop over all the security control cubes and use Bedrock to copy over the fixed cell values from the source groups to the new target groups.

For the }ElementAttributes_}Groups cube, where you can have aliases, this will be an issue. The new group cannot have the same alias value as the old security group. Therefore, if we add a prefix or suffix to make it unique, we are good. After that, you can remove the old security groups, the alias value becomes available and you can adjust the alias value on the new security groups to be again the alias value from the old group.

I have been doing this exercise now 3 times and it's time consuming if you don't automate it.

Long story, hope it's clear :-)

I can imagine other use cases as well. Granted, not thousands :-) Copying values from 1 measure to another with a prefix or suffix to avoid a useless rule or yet another TI to write ourselves.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 21:31 schreef tomasfelcman @.***

:

Hi Wim, what is the use case of prefix and/or suffix? In what situations do you fin that useful (just curious)? I think there should also be specified the delimiter to use when doing the concatenation of the strings - currently there is | ' ' | being used. Would it make sense to add something like pStringCumulateDelimiter = ' '?

— Reply to this email directly, view it on GitHub https://github.com/cubewise-code/bedrock/pull/414#issuecomment-2292048425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDHULJZF2JYGEIAOFMME6TZRT6XRAVCNFSM6AAAAABMSEUVFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGA2DQNBSGU . You are receiving this because you authored the thread.Message ID: @.***>

wimgielis avatar Aug 15 '24 20:08 wimgielis

I also admit that I am not a big fan of the 1 in: AttrPutS( v3, sDim1, v1, v2, 1 );

It avoids clashes of alias values but it can become ugly too.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 22:09 schreef Wim Gielis @.***>:

Well, a delimiter would be good too. It would be an easy fix in the TI process. Not sure how useful it would be but it also does not cost a lot to implement.

If we get really wild we could use Expand() too. Something like:

%newvalue% (%oldvalue%)

Such that the old value is between brackets, after the new value.

Probably overkill to implement but let's see what feedback others post. A delimiter like a dash would already be a good simple option too, besides my space.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 22:02 schreef Wim Gielis @.***>:

Hello Tomas,

When you migrate a customer from on premise to the cloud, the customer often has CAMID security groups. If the customer has CAoC, they continue to work. If the customer does not, we have a problem. All such groups need to be renamed.

You copy over the }Groups dimension as well as all security related control cubes.

Swapping with an alias does not work on that }Groups dimension and corrupts the TM1 model. You should not that. Then, an alternative is to loop over the CAMID groups and create a new security group for each existing CAMID group. For instance, the new group name is the old group name except the namespace. Then you loop over all the security control cubes and use Bedrock to copy over the fixed cell values from the source groups to the new target groups.

For the }ElementAttributes_}Groups cube, where you can have aliases, this will be an issue. The new group cannot have the same alias value as the old security group. Therefore, if we add a prefix or suffix to make it unique, we are good. After that, you can remove the old security groups, the alias value becomes available and you can adjust the alias value on the new security groups to be again the alias value from the old group.

I have been doing this exercise now 3 times and it's time consuming if you don't automate it.

Long story, hope it's clear :-)

I can imagine other use cases as well. Granted, not thousands :-) Copying values from 1 measure to another with a prefix or suffix to avoid a useless rule or yet another TI to write ourselves.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 21:31 schreef tomasfelcman @.***

:

Hi Wim, what is the use case of prefix and/or suffix? In what situations do you fin that useful (just curious)? I think there should also be specified the delimiter to use when doing the concatenation of the strings - currently there is | ' ' | being used. Would it make sense to add something like pStringCumulateDelimiter = ' '?

— Reply to this email directly, view it on GitHub < https://github.com/cubewise-code/bedrock/pull/414#issuecomment-2292048425>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEDHULJZF2JYGEIAOFMME6TZRT6XRAVCNFSM6AAAAABMSEUVFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGA2DQNBSGU>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/cubewise-code/bedrock/pull/414#issuecomment-2292129571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDHULL3C4FHB7XH6QGKGS3ZRUDF5AVCNFSM6AAAAABMSEUVFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGEZDSNJXGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wimgielis avatar Aug 15 '24 20:08 wimgielis

Another option to solve the problem of renaming/duplicating groups in PAoC (or elsewhere): you could delete groups or not transfer them by copying the }Groups dimension from on premise.

Then add the desired group names in the target environment. And use Bedrock or your own processes to dump the cube cells to text files and import again on the new group name. That seems to be more work and error prone when working with text files. The TM1 REST API could be a solution but then the source environment needs to be accessible too with the REST API. Older environments (I am migrating some such) before TM1 10.2.2 are not. When the TM1 REST API works then tm1py is a good option too.

For now I stick with using AddGroup and then Bedrock to copy cell values in control cubes.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 22:35 schreef Wim Gielis @.***>:

I also admit that I am not a big fan of the 1 in: AttrPutS( v3, sDim1, v1, v2, 1 );

It avoids clashes of alias values but it can become ugly too.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 22:09 schreef Wim Gielis @.***>:

Well, a delimiter would be good too. It would be an easy fix in the TI process. Not sure how useful it would be but it also does not cost a lot to implement.

If we get really wild we could use Expand() too. Something like:

%newvalue% (%oldvalue%)

Such that the old value is between brackets, after the new value.

Probably overkill to implement but let's see what feedback others post. A delimiter like a dash would already be a good simple option too, besides my space.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 22:02 schreef Wim Gielis @.***>:

Hello Tomas,

When you migrate a customer from on premise to the cloud, the customer often has CAMID security groups. If the customer has CAoC, they continue to work. If the customer does not, we have a problem. All such groups need to be renamed.

You copy over the }Groups dimension as well as all security related control cubes.

Swapping with an alias does not work on that }Groups dimension and corrupts the TM1 model. You should not that. Then, an alternative is to loop over the CAMID groups and create a new security group for each existing CAMID group. For instance, the new group name is the old group name except the namespace. Then you loop over all the security control cubes and use Bedrock to copy over the fixed cell values from the source groups to the new target groups.

For the }ElementAttributes_}Groups cube, where you can have aliases, this will be an issue. The new group cannot have the same alias value as the old security group. Therefore, if we add a prefix or suffix to make it unique, we are good. After that, you can remove the old security groups, the alias value becomes available and you can adjust the alias value on the new security groups to be again the alias value from the old group.

I have been doing this exercise now 3 times and it's time consuming if you don't automate it.

Long story, hope it's clear :-)

I can imagine other use cases as well. Granted, not thousands :-) Copying values from 1 measure to another with a prefix or suffix to avoid a useless rule or yet another TI to write ourselves.


Best regards / Beste groeten,

Wim Gielis IBM Champion 2024 MS Excel MVP 2011-2014 https://www.wimgielis.com http://www.wimgielis.be

Op do 15 aug 2024 om 21:31 schreef tomasfelcman @.***

:

Hi Wim, what is the use case of prefix and/or suffix? In what situations do you fin that useful (just curious)? I think there should also be specified the delimiter to use when doing the concatenation of the strings - currently there is | ' ' | being used. Would it make sense to add something like pStringCumulateDelimiter = ' '?

— Reply to this email directly, view it on GitHub <

https://github.com/cubewise-code/bedrock/pull/414#issuecomment-2292048425>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AEDHULJZF2JYGEIAOFMME6TZRT6XRAVCNFSM6AAAAABMSEUVFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGA2DQNBSGU>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/cubewise-code/bedrock/pull/414#issuecomment-2292129571>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEDHULL3C4FHB7XH6QGKGS3ZRUDF5AVCNFSM6AAAAABMSEUVFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGEZDSNJXGE>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/cubewise-code/bedrock/pull/414#issuecomment-2292190221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDHULKZ4VDT5QXYAX74PNLZRUGHZAVCNFSM6AAAAABMSEUVFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGE4TAMRSGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wimgielis avatar Aug 15 '24 22:08 wimgielis