12 Replies Latest reply: Nov 2, 2017 8:21 AM by omar bensalem RSS

    Compare variable value to field value ..?

    omar bensalem

      Hi all, stalwar1

       

      I have a variable defined as follow:

       

      UserID:  =subfield(osuser(),'\',1)  : since I'm using the desktop; its value is : Me

       

      I have a table containing all user Ids and their names:

       

      example:

       

      Load * inline [

      UT, UserName

      Me, Omar Ben Salem   

      Other, other user

      ];


      What I want is to update my variable from Me to Me (Omar Ben Salem) : which is

      :Subfield(Osuser(),'\',1)&' ('& UserName of UT = Subfield(Osuser(),'\',1) &')'


      What I did is this:

      =Subfield(Osuser(),'\',1)&'('& aggr(Only({<UT ={"$(=UserID)"}>} UserName ),UserName)&')'


      It partially works but it returns :

      Capture.PNG


      Why it's returing the Me() thing? I just want it to return Me (Omar Ben Salem)


      Hope the explanation of my problem is clearer than the thread's title

      Thanks !