Manager - Sales-rep drill down report

[code]
SELECT 
FSU.parentsystemuseridname AS Manager
, FSU.fullname AS 'Sales Rep'
, FSU3.fullname AS 'Level 3'
FROM FilteredSystemUser AS FSU
LEFT JOIN FilteredSystemUser AS FSU3
ON FSU.fullname = FSU3.parentsystemuseridname
[\/code]
There are multiple levels in the hierarchy but i am showing 3 levels only in the sample query above. I am trying to create a drill down SSRS report which shows the hierarchy. It works fine with a small problem.
Problem:
1.) Manager is a sales rep himself so in the "sales rep " column manager should be shown along with his associates with a null value for the "Level 3 " column.
2.) In the same way Sales rep should also be present along with his associates in "Level 3 " column.
Please help me with your ideas for the query. Thanks in advance.
Oracle 11g database.

Hi,
If you can show what you need to do using commonly available tables, such as those in the scott schema, then you don't need to post any sample data; just the results you want from the given data, and an explanation of how you get those results from that data.
For example, using the scott.emp table (where the relevant raw data, which you can get from this query:
SELECT    empno, ename, mgr
FROM   scott.emp
ORDER BY  empno;
is
     EMPNO ENAME             MGR
      7369 SMITH            7902
      7499 ALLEN            7698
      7521 WARD             7698
      7566 JONES            7839
      7654 MARTIN           7698
      7698 BLAKE            7839
      7782 CLARK            7839
      7788 SCOTT            7566
      7839 KING
      7844 TURNER           7698
      7876 ADAMS            7788
      7900 JAMES            7698
      7902 FORD             7566
      7934 MILLER           7782
that is:
KING is the parent of JONES, BLAKE and CLARK,
JONES is the parent of SCOTT and FORD, and
SCOTT is the parent of ADAMS, and
you can get output like this:
CHAIN_O_COMMAND
KING
KING      JONES
KING      JONES     SCOTT
KING      JONES     SCOTT     ADAMS
KING      JONES     FORD
KING      JONES     FORD      SMITH
KING      BLAKE
KING      BLAKE     ALLEN
KING      BLAKE     WARD
KING      BLAKE     MARTIN
KING      BLAKE     TURNER
KING      BLAKE     JAMES
KING      CLARK
KING      CLARK     MILLER
using a query like this:
SELECT  REPLACE ( SYS_CONNECT_BY_PATH ( RPAD (ename, 10)
                )         AS chain_o_command
FROM    scott.emp
START WITH  mgr  IS NULL
CONNECT BY  mgr  = PRIOR empno
Notice that the result set only has 1 long column, but it's formatted to look like multiple short columns.  That's because the number of columns in the result set must be hard-coded in the query.  If you don't know how many columns you'll need (because you don't know how many levels will be in the tree) this is one way to avoid dynamic SQL.

Similar Messages

  • FSI0 - Drill Down Reports for Account Balance Analysis

    Any orientation on this issue will be greatly appreciated.
    These are the steps I did to create a new Drill-Down Report for my customer.
    1. Created and modified a new Form based on the Form for the Financial Statement Analysis 0SAPBLNCE-04 (Periodic Actual vs Actual) using Transaction FSI4 (Create) and FSI5 (Change)
    2. Created and modified a new Report with reference to the Form I just created using transactions FSI1 (Create) and FSI2 (Change)
    3. I select "Expand: Completely" to see all Account Balances
    3. All the totals match between the Original Standard Report and the new report I just created.
    4. On both reports, when I select a Balance and then select the GOTO \ Line Items to get the list of documents I get the following results:
    ==> Most of the cases (I would say probably 80% of the cases) the Account Balance I selected matches with the Total of Line Items that is displayed when I do the GOTO \ Line Items
    ==> In some cases (just a few) the Account Balance does not match at all with the totals of Line Items that is displayed when I do the GOTO \ Line Items
    Can somebody explain why ? Shouldn't the totals match all the time since I am specifically selecting a balance to see all its line items? Where are the missing line items?
    Since these are just a few cases my customer is okay with it but he would like to hear a logic explanation why the Account Balance and its line items do not match on this report.

    Hello,
    There is a possibility that you have activate line item display for some of the accounts at a later stage. Meaning that earlier postings were not be shown for the earlier postings but only totals will be made available. Therefore, obviously there is bound to be difference between line item report and totals report.
    You need to identify which accounts are being changed with line item display at a later stage.
    In case if you forget to keep GL Line item display for an account, but the posting are already made the following steps you would required to get the line item display retrospectively.
    1. Note that you are NOT required to make the balance of that GL account to ZERO. Please do not confuse with Open Item Management.
    2. Put the check box line item display for the account in FS00. Make sure you are entering right company code.
    3. Block the account for posting in COA Segment and Company Code Segment in FS00
    4. Go to SA38 and run program RFSEPA01 (Give correct GL Account and Company Code)
    5. Now, remove the block you kept on the GL Account in FS00.
    This will reset the line item display retrospectively.
    Hope this will solve your problem.
    Regards,
    Ravi

  • How to create drill down reports

    pelase help me step to create drill down reports
    Find the manager and their employees Manager names are abc, def employees are abc manager employees are john, lilly.
    def employees are mark,syam
    How can i acheive below format.
    abc-manager
    John
    lilly
    DEF--manager
    Mark
    Syam
    Pelase help me
    Edited by: 893185 on Jun 7, 2012 3:36 PM

    >
    After 213 posts you should have a real handle instead of "893185". Please edit your profile with one as a matter of urgency.
    pelase help me step to create drill down reports
    Find the manager and their employees Manager names are abc, def employees are abc manager employees are john, lilly.
    def employees are mark,syam
    How can i acheive below format.
    abc-manager
    John
    lilly
    DEF--manager
    Mark
    SyamSounds like homework.
    How to Create a Drill Down Report
    Don't see the relevance of this format to "drill down reports". What is drilling down to where?

  • Drill Down Reports - Very Urgent

    I have the following situation.
    I want to create a drill down report and pass parameters from the
    master report to the detail.
    I built 2 simple tabular reports Drill1 (master) and Drill2 (detail). I have placed a button in the repeating frame of the Drill1 report, and I wrote the following code in its trigger:
    srw.run_report('report=DRILL2');
    I have tested the report and it works just fine.
    But .... I want to pass as a parameter to the second report the value of a field. According to the documentation I shall change the button trigger to
    srw.run_report('report=DRILL2 paramform=No p_1=''' || :field1 || ''''); -- (the value is a string)
    I did so but it gives me the REP-0159 error. Am I doing something wrong?
    Note that I am using reports version 6.8.12.1
    Thanks
    Ioanna

    hi Ioanna,
    The Problem seems to be with the quotes in your srw.run_report command line . The appropriate commandline should be
    srw.run_report('report=DRILL2 paramform=No p_1='||:field1||' ... <rest of the cmd line >');
    ( note the quotes before / after ||:fie1d1|| .. )
    Regards
    Oracle Reports Team

  • Drill Down Report (Denes Kubicek)

    Hi Denes and everyone
    I would like to create a drill down report.
    I have 5 tables namely:
    1. Method (method varchar2(60) PK)
    2. Category (cat varchar2(60) PK, method varchar2(60) FK)
    3. Skill_type (type varchar2(60) PK, cat varchar2(60) FK, method varchar2(60) FK)
    4. Skills (type varchar2(60) FK, empno NUMBER FK, status char(1))
    5. Emp (fname varchar2(60), lname varchar2(60), empno NUMBER PK)
    and a view between Skills and Skill_type: (type varchar2(60) FK, empno NUMBER FK, status char(1))
    The user should select a method he/she obtained the skills (e.g. Internally or externally) then after selecting it drills down to skill category (e.g. systems, softskills, technical or HR) then the user should click a category and drills down to skill type (e.g. microsoft word, conflict management or A+) here the user should click a checkbox or Y to indicate which skills he/she have and then click a submit/save button which updates/insert the view/skills table(4).
    Example
    Surname     Name     softskills                                                   Microsoft               
              Leadership Change_Management Motivation Conflict_Management    MS_Projects MS_Word MS_PowerPoint MS_Excel
    james     pete          Y               Y                                  Y          Is there anyway I can use a drill down report, tabular form or anyother options.
    Your guidance will be appreciated.
    Kind regards
    Mel

    I got a solution for drill down, all i need is updating the skills table
    here the user should click a checkbox or Y to indicate which skills he/she have and then click a submit/save button which updates/insert the view/skills table(4).
    Example
    Surname     Name     softskills                                                   Microsoft               
              Leadership Change_Management Motivation Conflict_Management    MS_Projects MS_Word MS_PowerPoint MS_Excel
    james     pete          Y               Y                                  Y     Thanks

  • Agregated value in original report in not same as the drill down report

    Hello experts,
    I have a issue with the drill down reports.
    Agregated value in the main report is not equal to the agregarated value in the drill down report.
    In my report I have a sales for jan 2011,feb 2011 so on
    For jan 2011 it is some thing $56000
    when I click on this amount it giving the detail level for each region sales and at the end it is giving the total sales for jan 2011 as $98000
    My question is why there such difference in the total amount when we are drilling down?
    Please help me in this regard. I am new to obiee.

    hello
    do you have any filters on this report that would related to measures?
    if so, remove these filters and see if you still get different values;
    rgds

  • Drill Down Report issues in VS 2010, CR viewer 12

    We are using VS 2010, Crystal Reports 12 with Crystal Viewer 12 control called from a C# programmed page frame.  Several Drill Down reports are developed with CR 12 service pack 1 and then deployed onto the server. 
    These Drill Down reports work great within the viewer.  But Two critical issues have been discovered,
    1.     With the drop down report, the next /last page buttons work on the main page, but it doesnu2019t work on any of the drill drop sections.
    2.     The print / export functions work on the main page.  Using the print / export functions from the Drilled down pages reverts back to the main page, not the drill down page that is being viewed.
    Has anyone else seen these issues and know of a fix.  Wondering if it might be something in the viewer settings within the .net or the version of viewer ?
    I have viewed the CR .Net API Reference but probably due to lack of .net knowledge, seems overwhelming  to me.
    Thanks

    Hello,
    Hope you can use this code to export report in pdf with the drill down options/nodes.
    CrystalDecisions.CrystalReports.Engine.ReportDocument rd = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
       /// Calling a sample report named Employee Sales.rpt with parameter
       rd.Load(Application.StartupPath + \\..\\..\\Employee Sales.rpt);
       rd.SetParameterValue("Login Name","Robert King");
       ISCDReportClientDocument rcd = rd.ReportClientDocument;
       ISCRPDFExportFormatOptions exportFormat = new PDFExportFormatOptionsClass();
       exportFormat.CreateBookmarksFromGroupTree = true;
       //Create an array of bytes of the report.
       PrintOutputController rasPrintOutputController;
       rasPrintOutputController = rcd.PrintOutputController;
       // Define the export format as PDF, and apply the PDF export options
       CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions expOpts = new CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptionsClass();
       expOpts.ExportFormatType = CrReportExportFormatEnum.crReportExportFormatPDF;
       expOpts.FormatOptions = exportFormat;
       // Use the PrintOutputController class to export the report based on the defined export options.
       ByteArray tempByteArray = rcd.PrintOutputController.ExportEx(expOpts);
       Byte[] byteStreamOutput = tempByteArray.ByteArray;
       // Create a new file(MyExportedReport) with the specified path, name, and file extension.
       FileStream fs = new FileStream("C:\\Windows\\Temp\\MyExportedReport.pdf", FileMode.Create, FileAccess.ReadWrite);
       // Stream the bytes from the exported report to the newly created file and close the file stream.
       int maxSize = byteStreamOutput.Length;
       fs.Write(byteStreamOutput, 0, maxSize);
       fs.Close();
       MessageBox.Show("Export is done in C:\\Windows\\Temp location");
    Thanks.

  • Drill down report ...  prompt in last level

    Hai,
    can you please send solution in obiee 10g .. I have drill down report like year---qtr----month----day----. I want prompt in day level .. is it possible?
    Appreciate your help....
    Thanks Mikky99

    Hi Srini thanks,
    Also I need to capture the particular days in month report like year(2002)-----month(feb2002) ----- day (1-Feb-2002) in day level rep with prompt...
    Thanks in Advance

  • How To Create Drill down report in oracle report 6i version

    HI,
    I have one table having dept no , emp_no ,Sal like field.
    I want drill down report master column dept_no.
    i want one click on dept_no & i want to see detail of emp & Sal on it
    How can i do this please guide me.
    Thanks in advance
    Rahil

    Hi
    One simple concept is,
    Make dept only report call it as dept.rdf
    Now create another report call it as emp_details.rdf,
    Now in Dept.rdf. Make push button and call the emp_details repot by passing dept no varailble.
    Hope you got idea of drill Down on 6I
    Edited by: O.Developer on Dec 19, 2012 9:20 AM

  • Drill down Report in Xcelsius

    Hi All,
    I am new to BO i dont know much in BO.Is it possible to create Drill down Reports in Xcelsius.
    For Example,
    Sales Org     Revenue
    A                   10000
    B                    20000
    If we select Sales Organization A or B then the Report would be
    Sales Org       Material Group            Revenue
    A                              10          5000
    A                              20          5000
    B                              30          10000
    B                              40          10000
    If we select  Sales Org A or B then the Report would be
    Sales Org     Material Group       Material          Revenue
    A                              10          MAT01               3000
    A                              10          MAT02               2000
    A                              20          MAT03               5000
    B                              30          MAT04               10000
    B                              40          MAT05               10000
    Like this i want to display the Report.How it possible in Xcelsius.Please help me it will be more useful.
    Thanks,
    Shiva
    Edited by: siva kumar on Dec 5, 2011 7:50 PM

    you can do drill in xcelsisu but for that you need to create 2 webi reports r use 2 different queries .(i dont know which verion of BI you are on)
    how mnay organizations do you have if its a small number that you can create a lay out with drop down on left for organization and create 2 tables 1 for organization a data.. if pressed to be visible and 1 for b..
    and if 1 and 2 are pressed then show the tired table with both data.
    do it in excel using live office webi connection to bring the data in then import the data in excelsisu.. do all your calculations in excel first then bring it to Xcelsius
    If we select Sales Organization A or B then the Report would be
    Sales Org Material Group Revenue
    A 10 5000
    A 20 5000
    B 30 10000
    B 40 10000
    If we select Sales Org A or B then the Report would be ( i think you mean and here)
    Sales Org Material Group Material Revenue
    A 10 MAT01 3000
    A 10 MAT02 2000
    A 20 MAT03 5000
    B 30 MAT04 10000
    B 40 MAT05 10000

  • Unable to pass parameter from a hyperlink in drill down report

    Hi,
    I have created a drill down report.
    Master report has a column with hyperlink
    with url to call detail report.
    "http://webserver/dev60cgi/RWCGI60.EXE?item+the_prodid=200376"
    when i see the detail report i get the value of the_prodid parameter as null.
    any help will be highly appreciated.

    Thanks very much.
    It worked for me also.
    Now i am getting here something new
    i have wrriten a function which returs javascript and i this is being passed to report using before report trigger.
    I am using
    SRW.SET_BEFORE_REPORT_HTML(SRW.TEXT_ESCAPE,HTML_Text) tag to do this.
    When i run this report from report builder it works fine but when this is invoked from
    a report server i get a blank page and the window status says tranferrring data from webserver nothing comes up.
    Now when i remove the contents of before report trigger it works fine.
    my before report trigger conetenst are
    function Before_Report return boolean is
    HTML_Text VarChar2(32000);
    begin
    HTML_Text := '<html> ' &#0124; &#0124;chr(10)&#0124; &#0124;
    mainpagejavascript&#0124; &#0124;
    '<body dir=LTR bgcolor="#ffffff">'&#0124; &#0124;chr(10); -- for 6i the body tag dir=&Direction would work and be set at runtime
    SRW.SET_BEFORE_REPORT_HTML(SRW.TEXT_ESCAPE,HTML_Text);
    return (TRUE);
    end;
    mainpagejavascript function returns
    <script language="javascipt">
    function test()
    alert("I have a problem");
    </script>
    can anybody help me out in this.
    Thanks in advance
    shailesh
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Haithem Abdelkefi:
    Yes, the drill down works.
    We have a field with this Format Trigger.
    function F_EQP_GRPFormatTrigger return boolean is
    begin
    srw.set_hyperlink (:p_url| |'&report=INP-A2.2.rep&p_eqp_grp='| |:eqp| |'&desformat='| |:desformat);
    return (TRUE);
    end;
    Haithem<HR></BLOCKQUOTE>
    null

  • Export current view or drill down report

    Post Author: Rainer
    CA Forum: Exporting
    My Enviroment: CR XI, Delphi,  ActiveXReportViewer Hello together,how can I export the current view or a drilled down report with the COM object.I didn't find a way to get the current view object (IReport) I think  there must be a solution, because the default export method can export the current view.Thanks Rainer 

    Post Author: jarrodnewman
    CA Forum: Exporting
    My setup isn't exactly the same but this might help you:  I had this problem with Crystal.Net in Visual Studio 2005.  This link helped me resolve it.  http://diamond.businessobjects.com/node/1956
    My export routine used to just export the ReportDocument object.  But this object does not contain any information on the currently displayed group level.  So when I built a report modeled very closely after the sample 'World Sales Report.rpt' my export routine would only export the main view even if I was drilled down into other group levels of the report.  I learned that the CrystalReportsViewer object is what contains the drill-down level in the ViewInfo.ViewContext object.  So the link above solved this for me. 
    As a side note, I also had to manipulate suppressing and unsuppressing sections on export which can't be done via the CrystalReportsViewer object.  So I had to save a copy of the current ViewInfo object to local variable.  Then I modified the ReportDocument object to unsuppress and suppress certain sections.  Then I set this modified ReportDocument object as the RecordSource of the CrystalReportsViewer object and passed as parameters the new NonHTTPCachedReportSource object and the saved ViewInfo object to my new export routine.  This allowed me to preserve the drill-down view properties but apply it to a different ReportSource.  I can supply (c#) code if needed.  ( I don't usually show the ReportHeader or PageFooter sections in my online view of reports but I need to show them when I export a report)...
    - Jarrod ([email protected])

  • Creating drill-down reports

    Hi,
    I'm using reports6i.
    I want to create a drill down report, the main report is AgentDetails.rdf , in that i've placed a button to call AgentContacts.rdf.
    But i want to pass parameters from AgentDetails to AgentContacts. So what code i need to write for the buttons action?
    Please guide me how to do this?

    Hi,
    I've written this in the PL/SQL of the button
    procedure U_1ButtonAction is
    begin
    srw.run_report('report=AgentContacts.rdf
              p_code='||:AMR_CODE||' P_company='||:P_COMPANY||' P_catg='||:P_CATG||'
              P_USER='||:P_USER||'  paramform=no');
    end;But i'm getting these errors
    REP_0159:Syntax Error on Commandline
    REP-1428:'u_1buttonaction':Error While Running SRW.RUN_REPORT
    Please Help

  • Sorting drill down report

    Mr. Kubicek's "Report on Report" is excellent if anyone is looking for a drill down report, but if Denes or someone could help me with one last piece, I would be indebted.
    I have aggregated values for the columns I wanted to total for each employee in Report 1: "Total # of Sales" and "Total $ Sales". These totals become links for the drill down in Report 2. Clicking on the aggregate total of "Total $ Sales" in Report 1 will show all related individual sales records for that employee in Report 2.
    My problem is in sorting Report 1 by the aggregate columns, "Total # of Employees" and "Total $ Sales". The columns do not sort correctly from high to low etc. I have copied Denes report code exactly. What do I add or change to sort these two aggregate columns from high to low? Thank you all.
    Mike

    Thanks so much, Dimitri. I don't have the link, but here is my query (does this give you enough to diagnose?). The columns etc differ from my original post (I was trying to keep it simple in my example...).
    SELECT "l_t_num","l_truck_name",
    '<span style="font-weight:bold;">'
    || '<a href="f?p=&APP_ID.:113:&SESSION.::NO::'
             || 'P113_TRUCKNO,P113_TRUCKNO_COUNT,P113_TRUCKNO_PAID:'
             || l_t_num"
    || ','
    || "l_t_num"
    || ','
    || NULL
    || '">'
    || COUNT (*)
    || '</a></span>' "l_file_number",
    '<span style="font-weight:bold;">'
    || '<a href="f?p=&APP_ID.:113:&SESSION.::NO::'
    || 'P113_TRUCKNO,P113_TRUCKNO_COUNT,P113_TRUCKNO_PAID:'
    || "l_t_num"
    || ','
    || NULL
    || ','
    || "l_t_num"
    || '">'
    || TO_CHAR (SUM ("l_due_to_truck"), 'FML999G999G999G999G990')
    || '</a></span>' sum_truck_cost
    FROM "LOADS_HISTORY_NC"
    where instr(':' || :P113_YEAR || ':',SUBSTR("l_file_number",3,2)) > 0
    AND instr(':' || :P113_MONTH || ':', SUBSTR("l_file_number",5,2)) > 0
    GROUP BY "l_t_num", "l_truck_name"
    The two results columns are 'sum_truck_cost' and a count of "l_file_number" for each carrier ("l_truck_name"). These two columns in my report are aggregate values and are links. Clicking on either the 'sum_truck_cost' value or count value opens a second report with the individual records. I have enabled the sorting option for these columns in Report Attributes, but manually sorting the columns does not put the records in correct asc or desc order based on either total.
    This is almost exactly as Denes has on his site, so he has a working example. I have only inserted my own columns into his code etc. Thank you so much Dimitri!!
    Mike

  • Drill Down Report 6i

    I m using this code in repeating fame
       Srw.run_report('module=JV.rep  destype=Screen  paramform=No
       vmdate='||:vdate1 ||' vm_no='||:vno1||'  vtype='||:vtype1);  
        EXCEPTION
          when srw.run_report_failure then
          srw.message(30, 'Error in reports.');
          raise srw.program_abort; showing me the error
    SRW.RUN_Report can not be invoked with batch=no
    then I added
    Srw.run_report('module=JV.rep  destype=Screen  paramform=No batch=yes
       vmdate='||:vdate1 ||' vm_no='||:vno1||'  vtype='||:vtype1);  
        EXCEPTION
          when srw.run_report_failure then
          srw.message(30, 'Error in reports.');
          raise srw.program_abort; again showing user define error
    30, 'Error in reports.
    rep-1419 r_g_vdate1 formattriggers PL/SQL Program Aborted.
    if I write this code in button it is working , but i dont want to show button on my report, because when we print this report button also print.
    how can I define above code in repeating frame?

    if I write this code in button it is working , but i dont want to show button on my report, because when we print this report button also print.And what do you expect to happen? At what time should the drill down-reports be printed? And how should they be shown?
    If you want to include the rsult in your main-report, you should create an additional query in your "main"-report.

Maybe you are looking for

  • Ajuda: Quero apagar uma senha e nao consigo

    Quero instalar o Silverlight e nao consigo porque é pedido uma senha de acesso em meu proprio computador. Nao lembro a senha e nem lembro que coloque esta senha. Como faç para apagar essa tal senha de acesso e conseguir instalar o Silverlight para as

  • Video appearing in a different location

    Hello everyone, I'm somewhat new to Dreamweaver and just completed a website with embedded QuickTime videos. All the pages look identical except for one in which the video appears in a different location on the web, than it does in Dreamweaver and th

  • 8703e can't file messages in folders

    I have had my 8703e for a year and love the ability to access my business email from anywhere and access my email folders to organize emails.  Last week I suddenly could not file any emails in the folders.  I can see the folders but when I hit file,

  • Windows XP on a Mac

    So... I know you can Put windows on a mac... I've just bought a mac mini, and i'm gonna put boot camp on it... so now my question is, Does it have to be Windows XP PRO or can it be windows XP Media Edition-

  • My disk was full. I transfered data to a hard disk and emptied my trash...but my disk is still full!...how can i do?

    My disk was full. I transfered data to a hard disk and emptied my trash...but my disk is still full!...how can i do? Thanks I had this answer : When you copy data from one drive to another, it is not removed from the first drive - you need to trash i