Automate

 View Only
  • 1.  Reporting in Evolve - SQL query to link created by GUID with name

    Posted 09-16-2021 04:58

    Following advice from Jayasri Varyani FAQ - Reporting in Evolve/Studio Manager
    I am trying to create a report that lists all existing scripts, their app, and the name of the creator.
    So far in the Created by column, I only get a GUID. Is it possible to get the name there instead?

    The SQL Query:
    Select Distinct (RPT_SolutionView.Title) AS 'ScriptName',RPT_SolutionView.Description AS 'Description',RPT_AppGroupView.Appname AS 'AppID',RPT_SolutionView.CreatedBy AS 'Createdby' FROM [RPT_SolutionView]
    JOIN RPT_APPGroupView on RPT_SolutionView.AppId = RPT_APPGroupView.Appid where RPT_SolutionView.ScriptType in (0,1)

    Thank you,



    ------------------------------
    Olga Lotherington | Project Manager
    Yara International Asa | 90083039
    ------------------------------


  • 2.  RE: Reporting in Evolve - SQL query to link created by GUID with name

    Employee
    Posted 09-17-2021 09:21
    Hi Olga
    There is a table name called User that you can join.  See my example below. 
    I changed up your SQL a bit, but in reality, you just need one more inner join - joining CreatedBy with UserId.  Output DisplayName.  I also added AppName, which was available already.


    Hope that helps,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 3.  RE: Reporting in Evolve - SQL query to link created by GUID with name

    Posted 09-27-2021 07:39
    Thank you Sigrid.
    I am not too familiar with SQL queries, unfortunately. I am just trying with some common sense, which does not seem to be good enough in this particular case.

    I wrote the following:

    Select Distinct (RPT_SolutionView.Title) AS 'ScriptName',RPT_SolutionView.Description AS 'Description',RPT_AppGroupView.Appname AS 'AppID',RPT_UserView.DisplayName AS 'Createdby' FROM [RPT_SolutionView]
    JOIN RPT_APPGroupView on RPT_SolutionView.AppId = RPT_APPGroupView.Appid where RPT_SolutionView.ScriptType in (0,1)
    JOIN RPT_UserView on RPT_SolutionView.CreatedBy = RPT_UserView.UserId

    And got an error message "Please provide valid Query"

    ------------------------------
    Olga Lotherington | Project Manager
    Yara International Asa | 90083039
    ------------------------------