Use of @user / @username to segregate data

Options

We have a capsule which does some kind-of complicated processing such as writing to a text file from a dataflow and reading it back in to some work cubes and then displaying a screen based on the work cubes. If more than one user is using the capsule it works alright. When user A loads the work cubes and displays results and user B then loads the work cubes and displays results then user A's view of the data is not affected unless they refresh their screen and then they see unexpectedly user B's version of the data. 

I am wondering if the data could be separated by adding a user ID entity as a work cube dimension, loading it be referring to the substitution formula @user (or @username) and filtering the work cube that way. The hoped-for effect is user A would have work cube dimensioned with A and user B would have work cube dimensioned with B and regardless of whether someone refreshes their screen they would only see their own data. The capsule will potentially be used by several users at a time. 

Any thoughts, work-arounds, suggestions? 

Thank you

Tagged:

Answers

  • Helmut Heimann
    Options

    Hi Peter DeGregorio,

     

    you're on the right way :-)

     

    1. Define an entity to reflect your users A, B and further
    2. Add this entity as a dimension to your work cube
    3. Define a custom select script in the user's profile in the form select <your user-entity> = @user. This will allow the system to assign the user currently running the procedure to the user-dimension in your work cube.

     

    That's it.

     

    Kind Regards,

    Helmut

  • Unknown
    Unknown Active Partner
    Options

    Hi Helmut,

    That's indeed a simple and effective method. The only problem with this method, is that you can't share screens with another user in the presentation mode (as the user profiles will not be aligned).

    To overcome this issue, you can use a cube that gets dynamically populated in a go to screen procedure (something like if(Entity(user)=@user;1;0) when entering certain screens and use a select entity "user" based on this cube. However when sharing a presentation, you will basically allow the other user to enter with your "user" certain screens.

    We use both methods depending on the requirements.

    Hope this helps!

    All the best,
    Jonathan

  • Peter DeGregorio
    Options

    Thank you Helmut Heimann and Jonathan Baetens  for the very helpful replies and point about presentations.