Adding two if loops to a statement

Post Reply
simon_pr3
Posts: 7
Joined: Fri Sep 22, 2023 7:36 am
OLAP Product: tm1 Planning Analytics
Version: tm1 Planning Analytics 2.0
Excel Version: 97

Adding two if loops to a statement

Post by simon_pr3 »

I have two custom cubes to lock dimensions:

and the cube so_securitykhslperio:
with following dimension:
kh_jahr
kh_slperio
kh_versi
and }Groups (a "control object" for companies)

in so_security_kh_versio
with following dimension:
kh_jahr
kh_perio
kh_versi
and }Groups (a "control object" for companies)

I would like to use those two in an if statement to cancel a TI process if the comibination is not empty,

I was guessing something like that might work:
Aenderung=CellGetS('so_security_kh_versi',kh_jahr,kh_perio,kh_versi,}Groups);
if(Aenderung@<>'');


But there seems to be a problem with the "control objects".

Maybe someone of you can help me on that.

In addition it would be great to get a decent error message for the user, which period is locked if the process cancels. It could simply say: periode is locked.

Thank you for your help,

BR Simon
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Adding two if loops to a statement

Post by Wim Gielis »

Hello,

Can I ask you why you don’t finish your words and dimension names? It seems weird to have dimension names like that. I have never seen such strange dimension names.

You mentioned that you have double loops, but I don’t see any code for that.

I would also like to question your cube design. Instead of the }Groups dimension, why not taking your real company dimension in the cube? I assume you are loading data by company, year, period and version.

In addition, you are missing a measures dimension for that cubes.

Ultimately, it’s a user who executes the process. Then with a loop you retrieve the group names for that user.
Then for those groups, you retrieve the element security for the companies to know which group has access to which companies.
If at this point, no companies survive, you can already stop the process. For the companies that do survive, you can look into the cube for the period for which the user wants to load data, and retrieve the setting from the cube. For example, measure Open = 1 and you can continue the process.

If the user is part of the admin security group, then you can already stop the checks and continue the process. Taking into account that the process could be run by its shore, and hence, it has no real user behind it, but rather an admin kind of user.

Loops like this are extremely fast, so performance is not at all an issue. More likely, I expect that you will spend time to connect the different pieces of security.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
simon_pr3
Posts: 7
Joined: Fri Sep 22, 2023 7:36 am
OLAP Product: tm1 Planning Analytics
Version: tm1 Planning Analytics 2.0
Excel Version: 97

Re: Adding two if loops to a statement

Post by simon_pr3 »

I appreciate your feedback! The odd naming conventions have been this way since the system has been implemented, thus I can't change them.

I will try the loop by adding a respective measure.

BR Simon
ardi
Community Contributor
Posts: 152
Joined: Tue Apr 02, 2013 1:41 pm
OLAP Product: tm1, cognos bi
Version: from TM1 9.4 to PA 2.0.9.6
Excel Version: 2010
Location: Toronto, ON

Re: Adding two if loops to a statement

Post by ardi »

Wim Gielis wrote: Wed Mar 06, 2024 5:52 am Hello,

Can I ask you why you don’t finish your words and dimension names? It seems weird to have dimension names like that. I have never seen such strange dimension names.
lol: I was thinking exactly the same. Impossible to follow the question with these object names
Ardian Alikaj
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Adding two if loops to a statement

Post by Wim Gielis »

ardi wrote: Mon Mar 11, 2024 1:31 pm lol: I was thinking exactly the same. Impossible to follow the question with these object names
100% !
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply