BusinessObjects Board

Document Author

I am sure there must be an easy way to do this…
When the function DocumentAuthor () is displayed, it returns the UserName of the author. In our configuration these are numbers. How could I convert this so it returns the Name associated with this number?
Do you create a variable in the universe?

Thanks for your help.
:hb:


Olivier Masse :fr: (BOB member since 2002-08-29)

I suppose a cheap and nasty way to do this would be to create a variable with an If statement along the lines of:

If (DocumentAuthor()=1234) Then "Olivier Masse"
Else If (DocumentAuthor()=2345) Then "Oliviers Colleague"
etc.....

To get a little more advanced perhaps you have a database table with this lookup information?


Nick Daniels :uk: (BOB member since 2002-08-15)

Nick,

Thanks for this, I had created a variable with the if statement, but the problem we have is that we have many users (over 100) and therefore the variable was quite “messy”.

How would you link the table? I assume the table would look something like:

UserName | Name
123456789|Olivier Masse

Would you save this table to your Universe and link it to the function DocumentAuthor()? :confused:


Olivier Masse :fr: (BOB member since 2002-08-29)

Yeah, I did figure this would happen - but you never know…

I would add it to my universe and create an object based on the name…I’m not sure this is going to work now…and then try a statement along the lines of

If DocumentAuthor()=<UserName> Then <Name> Else "Unknown"

. Hmm might be worth a test but I think there must be a better resolution out there…


Nick Daniels :uk: (BOB member since 2002-08-15)

Too bad you couldn’t create a join/link on derived variables in reporter, Then it would be simple: Create a variable = DocumentAuthor(), Create a DP for the id|name table and then link them up … Now, where was that wish list for BOBJ 6.0+? [Edit - Cindy Wish List :wink:]

You could also make it a procedure … The DocumentAuthor() function ties to whatever is typed in under Author in File|Parameters (not the ID that was logged in under) … so if you went into each report and changed their 12345 id to their realname, it would work


Chris Pohl :us: (BOB member since 2002-06-18)

Thanks, I think I’ll be using this last solution and ask whoever is designing the report to make sure his or her full name in entered in the properties of the report.

:yesnod:


Olivier Masse :fr: (BOB member since 2002-08-29)

Unless I am missing something this is pretty simple. Make a cartesian join, or should I say no join :wink: , to the table that holds the ID and the NAME of the users and just use the following in the where clause of the NAME object…

USERS.ID = @Variable('BOUSER')

Now in your usual query add the NAME object. This will get u the current users name in every row…


avaksi :us: (BOB member since 2002-08-22)