Page 1 of 1

Adding two if loops to a statement

Posted: Tue Mar 05, 2024 7:58 am
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

Re: Adding two if loops to a statement

Posted: Wed Mar 06, 2024 5:52 am
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.

Re: Adding two if loops to a statement

Posted: Mon Mar 11, 2024 12:50 pm
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

Re: Adding two if loops to a statement

Posted: Mon Mar 11, 2024 1:31 pm
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

Re: Adding two if loops to a statement

Posted: Mon Mar 11, 2024 1:41 pm
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% !