Webi Report Refreshed By

Hi All

What is the command, that I can use which will display who run/refreshed the report. Looking to add this to the report

Many thanks
Sims

There isn’t one.

LastExecutionDate gets you when it was run, but there is no equivalent function to get the user who ran the query(s).

CurrentUser gets you the user currently logged in and viewing the document, but if the report was scheduled and the user is viewing an instance, that may not be the same as the person who actually ran the report.

You could try to capture at the query level so that the result is returned in the data instead of trying to get it at the report level.

It would be nice to have a LastExecutionUser() function. I just requested it. Go vote for it please. SAP login required.

You can do this if you have access to the universe or to someone who does. There are System Variables which can serve as the source of dimensions in your universe.

So I think a dimension with the SQL Expression as follows will get what you want.

@Variable('BOUSER')

Here is a basic eFashion universe report with some of the System Variables mentioned at the link above.

If you have a free-hand SQL rather than a universe query you can get at these System Variable values there too. The universe related ones do not make sense so I left them off and for some reason DOCID is generating a prompt so I left that out too.

SELECT GETDATE()     AS [Current Date],
@Variable('BOUSER')  AS [BOUSER],
@Variable('DOCNAME') AS [DOCNAME],
@Variable('DPNAME')  AS [DPNAME],
@Variable('DPTYPE')  AS [DPTYPE]

image

On a related topic, you can use these System Variables in the END_SQL parameter in the data foundation of your universes as described by Dallas Marks here.

You can tailor this setting to suit your own needs, but we use this…

/* [User]: @Variable('BOUSER'); [Document]: @Variable('DOCNAME'); [Data Provider]: @Variable('DPNAME'); [Universe]: @Variable('UNVNAME') */

That results in the universe query shown above generating the following script…

SELECT
         Agg_yr_qt_mt_mn_wk_rg_cy_sn_sr_qt_ma.Yr
       , SUM (Agg_yr_qt_mt_mn_wk_rg_cy_sn_sr_qt_ma.Quantity_sold)
       , 'nscheaffer'
       , '6129251'
       , 'System Variables'
       , 'Query 1'
       , 'DPUNIVERS'
       , '17530'
       , 'eFashion'
FROM     Agg_yr_qt_mt_mn_wk_rg_cy_sn_sr_qt_ma
GROUP BY Agg_yr_qt_mt_mn_wk_rg_cy_sn_sr_qt_ma.Yr;
/* [User]: 'nscheaffer'; [Document]: 'System Variables'; [Data Provider]: 'Query 1'; [Universe]: 'eFashion' */

Why you ask? This is helpful for us when troubleshooting issues since our DBAs can see the queries that are running on a particular database including the comment with the chosen System Variables.

Hope you can make something work for your situation given this information.

Noel

1 Like