Help needed to display a column in a query for report

Hello

I need your help for the display of the total quantity based on a column that is already read by the query. My query is below:


SELECT 'Order MO' we.wip_entity_name, msi.segment1 'MO Assembly. "
MSI.item_type ITU, we.primary_item_id,
TRUNC (wdj.scheduled_start_date) "regular MO Start Date."
WDJ.start_quantity 'MO planned Qty. "
WDJ.quantity_completed 'MO finished Qty. "
(wdj.start_quantity - wdj.quantity_completed) "MO remaining Qty."
(CASE
WHEN (SUBSTR (wdj.attribute7, 3) = mtrl.line_id)
AND we.primary_item_id <>mtrl.inventory_item_id
)
THEN we1.wip_entity_name
Of OTHER mtrh.request_number
END
) mo_number,.
(CASE
WHEN (SUBSTR (wdj.attribute7, 3) = mtrl.line_id)
AND we.primary_item_id <>mtrl.inventory_item_id
)
THEN msi2.segment1
END
) mo_assembly,.
(CASE
WHEN we.primary_item_id <>mtrl.inventory_item_id
THEN TRUNC (wdj.scheduled_start_date)
Of OTHER TRUNC (mtrl.date_required)
END
) scheduled_start_date,.
Mtrl.Quantity required_quantity,
NVL (mtrl.quantity_delivered,
NVL (mtrl.quantity_detailed, 0)
) issued_qty,.
Mtrl.line_id, msi.inventory_item_id, mtrl.header_id,
remaining_qty einv_mo_reserve_remain_qty (mtrl.line_id),
einv_get_real_onhand_qty (mtrl.organization_id,
Mtrl.inventory_item_id,
Mtrl.from_subinventory_code,
Mtrl.from_locator_id
) onhand.
DECODE (a.remain_qty,
0, (wdj.start_quantity - wdj.quantity_completed).
a.remain_qty
) mo_assy_remain_qty
OF wip_entities.
wip_entities we1,
wdj wip_discrete_jobs,
wip_discrete_jobs wdj1,
MSI mtl_system_items_b,
wip_lines wl,
mil mtl_item_locations
mtl_txn_request_lines mtrl,
mtl_txn_request_headers mtrh,
mfg_lookups ml,
mfg_lookups ml1,
mtl_system_items_b msi2,
wip_operation_resources wor,
(SELECT NVL (SUM (wdj.required_quantity - wdj.quantity_issued),))
0
) remain_qty,.
inventory_item_id
OF wip_requirement_operations wdj
WHERE wdj.organization_id = 205
GROUP BY inventory_item_id) a
WHERE we.organization_id = wdj.organization_id
AND we.wip_entity_id = wdj.wip_entity_id
AND wdj.organization_id = msi.organization_id
AND wdj.primary_item_id = msi.inventory_item_id
AND wdj.organization_id = mtrl.organization_id
AND wdj.organization_id = mil.organization_id
AND wdj.completion_subinventory = mil.subinventory_code
AND wdj.completion_locator_id = mil.inventory_location_id
AND SUBSTR (wdj.attribute7, 3) = mtrl.line_id
AND wdj.organization_id = wl.organization_id
AND wdj.line_id = wl.line_id
AND wdj.organization_id = wor.organization_id
AND wdj.wip_entity_id = wor.wip_entity_id
AND wor.autocharge_type = ml.lookup_code
AND ml.lookup_type = 'BOM_AUTOCHARGE_TYPE. '
AND mtrh.header_id = mtrl.header_id
AND mtrl.inventory_item_id = msi2.inventory_item_id
AND msi2.organization_id = wdj.organization_id
AND ml1.lookup_type = 'MTL_TXN_REQUEST_STATUS. '
AND ml1.lookup_code = mtrl.line_status
AND wdj.start_quantity > 0
AND wdj.start_quantity > wdj.quantity_completed
AND a.inventory_item_id = msi.inventory_item_id
AND mtrl.inventory_item_id = we1.primary_item_id
AND wdj1.wip_entity_id = we1.wip_entity_id
AND SUBSTR (wdj1.attribute7, 3) = mtrl.line_id
AND IN we.wip_entity_name
("8OAS4781EBR3011",
"8OAS4781EBT3007,"
"91AS7382EBR3003,"
'91AS7382EBT3001 '.
);

Expected results:
....... Line_ID Inventory_Item_ID Remaining_Qty Total_Rem_Qty
3066336 259376 150 150
2884782 259378 228 378
3066336 259378 150 378
2884782 281571 228 228

I need the total remaining qty based on the inventory_item_id (specimen o/p 2 & 3).

Thanks in advance.

You can either use functions of aggregation or analytical functions according to your requirement.

You did not mention exactly how your output should look like.

If you want the sum of the remaining_qty then

Select inventory_id, sum (remaining_qty) of (your query)
Inventory_id group.

If you want to than the sum of the remaining_qty as well as your previous output
then

use

Sum (remaining_qty) on total_rem_qty (inventory_id)

Here, you don't need to use any group of.

But it will be like a total cumulative.

If it is not your problem, give us your expected results.

Tags: Database

Similar Questions

  • Need to display different columns in a row

    Hello

    Im trying to get out a total sales person report for each month.

    for example:-person name sales of the month

    1                                 Jan                                1000

    1                                Feb                                2000

    2                                 March                            500

    2                                 Dec                                 300

    Is it possible to get the result as below

    1

    Jan                            1000

    Feb                             2000

    2

    March 500

    Dec                             300

    I need to show a relationship with the sales person 20 albums for a specified period with distribution of the month

    for example Jan Feb March April Total

    Person 1 10 30 10 10 60

    Person 2              0              0      29       0                   29

    Help, please

    Concerning

    Sakho

    Something like that?

    SELECT person_name,

    "Jan."

    "Feb."

    "Mar."

    "April,"

    «Can»,

    "Jun"

    "Jul"

    "Aug."

    "Ms."

    "Oct."

    "Nov."

    "Dec."

    total sum_sal

    Of

    (

    SELECT person_name,

    month_,

    sales,

    sum_sal

    Of

    (

    SELECT person_name,

    month_,

    sales,

    sum_sal,

    ROW_NUMBER() over (ORDER BY sum_sal DESC) rn

    Of

    (SELECT person_name,

    month_,

    sales,

    Sum(sales) OVER (PARTITION BY person_name) sum_sal

    FROM tablename))

    WHERE the rn<>

    PIVOT (sum(sales) to month_ IN ('JAN' AS "Jan",

    AS "Jan", "FEB"

    "MAR" AS "Mar."

    "APR" AS "April"

    "CAN" AS "can", he said.

    "JUN" AS "Jun"

    "JUL" AS "Jul."

    "AUG" AS "Aug"

    "MS" AS "Ms."

    "OCT" AS "OCT."

    "NOV" AS "NOV."

    'DEC' AS 'DEC'))

  • Compare and display several column data according to requirement

    Hello

    I have a requirement where I want to compare the data in two tables and display only the columns if there is a gap using the sql query.

    Tell userid, e-mail and phone number of the same employee is stored in two tables. Now, I want to compare data from e-mail and phone number of the two tables and display the e-mail and phone number as if they are different data.

    Employee table:

    user_id E-mail phone
    emp01[email protected]00200
    emp02[email protected]

    00300

    emp03[email protected]00400

    Table user_details:


    ID user_email user_phone
    emp01[email protected]00201
    emp02(null)00300
    emp03[email protected]00401


    Please note that both tables have completely different column names and the data may contain a null as well. What I want to achieve is to compare the same employee data in both tables and display columns that have a different value of user_details table; as:


    user_id user_email phone
    emp01[email protected]00201
    emp02(null)
    emp03[email protected]00401


    As the table column names are different, I can't use a join and less to know the difference. I tried this with the help of CASES after the WHERE clause for comparison of columns multiple but GOLD or AND the two would defy the condition to display all columns with different data for the same line.


    How to do this without creating a separate view or a table that I don't have write access? Pointers would be useful.


    -Thank you.


    No need for something like

    You just run

    Select k.user_id, k.id,.

    e.email, u.user_email,

    e.Phone, u.user_phone

    of user_key_table k

    left outer join

    e employee

    On k.user_id = e.user_id

    left outer join

    user_details u

    on k.user_id = u.id


    the rest is here just to simulate your tables (I don't want to create tables in my APEX Tablespace as there are far too many people already)

    Concerning

    Etbin

  • Need help, get message display driver has stopped working, but has recovered

    Had no problems until recently, my freezer of mouse and screen, then get message display driver has stopped working, but recovered it gets really bad, please help

    Hello

    1. what operating system do you use?
    2. What is the brand and model of your system?
    3. Once you get this error message?
    4. you did it before the issue of any material changes or software?

    Try the steps outlined in the methods mentioned below and let us know if it helps.
    Note: The following Microsoft Articles are applicable for Windows 7 and Vista.

    Method 1: Boot your system in clean boot mode and temporarily disable your antivirus software. Check if get the same error message or not.

    Step 1: Try now to the KB article to perform the clean boot:
    How to troubleshoot a problem by performing a clean boot in Windows Vista and Windows 7:
    http://support.Microsoft.com/kb/929135
    Important: After you used the clean boot in order to solve your problem follow step 7 to reset the computer to start as usual.

    Clean boot in XP:

    Try now to the KB article to perform the clean boot:
    http://support.Microsoft.com/kb/310353
    Important: After you use the clean boot in order to solve your problem follow the steps in the "steps to configure Windows to use a Normal startup state" section to start your system in normal mode.

    Step 2: Turn off the antivirus software:
    http://Windows.Microsoft.com/en-us/Windows7/disable-antivirus-software
    Important: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks

    Method 3: update the driver for

    Updated a hardware driver that is not working properly:
    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    Method 4: Please visit the manufacturer's website and download the latest driver for your graphics card.

    Method 5: Windows 7 power save settings reduces the voltage to the video card too well when it is inactive for some video cards.

    To resolve this problem, disable the display (Plugged In) turn it off and turn off the display (on battery) power settings by using one of the following methods:

    Use the Group Policy settings:
    To resolve this issue by using Group Policy settings, follow these steps:

    (a) click Start, type gpedit.msc in the search box and press ENTER.

    (b) in the local Group Policy Editor, expand models of administration under Computer Configuration, expand System, expand power management, and then click display and video settings.

    (c) in the dialog box that opens, double click on turn off the display (Plugged In), click active, type 0 in the box to turn the display Off (seconds), and then click OK.

    (d) in the dialog box that opens, double click on turn off the display (on drums), click active, type 0 in the box to turn the display Off (seconds), and then click OK.

    Use the powercfg command:
    To resolve this issue by using the powercfg command, follow these steps:

    (a) click Start, type command prompt in the search box, and then click command prompt in the list of results.

    (b) at the command prompt, type the following commands:
    powercfg - X-monitor-timeout-ac 0
    powercfg - X-monitor-timeout-dc 0

    Get back to us if the problem persists.

  • give user option to display a column in asc/desc as needed

    Hi all

    I have a report and I want to give the user the flexibility that it can display a column in a way asc/desc fields.
    Is it possible for a user to give an option as a button or some list drop down so that he can make a choice to view the results accordingly.

    If anyone can suggest a way... !

    Thank you

    Jin
    In a table view, we have the option "Enable column sorting in the dashboards.

    View table--> Table View Properties--> check the column enable sorting in dashboards.
    While in dashboard users have the flexibility to sort their reports asc/desc...

    Thank you
    saichand.v

  • Display / hide column IR dynamically

    Hello

    ApEx Oracle 10g and 11g 4.1.0.

    I need to be able to dynamically hide or display columns in an interactive report, based on a value of element (radio buttons), without reloading the page.

    I have two columns 'H' and 'Z' in my interactive report.
    I have a question P9_COORD_SYSTEM (radio buttons) which can return 'H' or 'Z '.
    And I want to show/hide the right according to the value of the column.

    I tried to set conditional display of column "H":

    -Condition Type: Point value / Expression 1 column = Expression 2
    -1 expression: P9_COORD_SYSTEM
    -Expression 2: H

    But it is not working, even reloading the report in question of the modified value:
    $('#P9_COORD_SYSTEM').change(function() {
         gReport.search('SEARCH');
    });
    I can show/hide the columns using Javascript, of course, but when I change the pagination in the report I have to hide/show columns every time...
    $('#P9_COORD_SYSTEM').change(function() {
         if ($v('P9_COORD_SYSTEM') == 'H') {
              $('#my_report').find('th[id="Z"], td[headers="Z"]').hide();
              $('#my_report').find('th[id="H"], td[headers="H"]').show();
         }
         else {
              $('#my_report').find('th[id="H"], td[headers="H"]').hide();
              $('#my_report').find('th[id="Z"], td[headers="Z"]').show();
         }
    });
    So it is not a solution...

    Is there any solutions for this?

    Thank you for your help.

    Yann.

    Yann39 wrote:
    Conditional display of column "H":
    -Condition Type: Point value / Expression 1 column = Expression 2
    -1 expression: P9_COORD_SYSTEM
    -Expression 2: H

    Hello

    Also remove leading colon to the name of the element in the Expression 1

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0

  • How to display 5 columns with blank lines

    Hi Experts,

    I need to display in the dashboard column 5 with blank lines. After download in excel I need to see the same thing as the names in columns 5 and that it must contain empty lines. It is one of the requirements of the user.

    So how do you achieve...

    Thanks in advance,
    Sitbon

    Next to all the answers of your son, you should see a button 'OK' or 'useful '.
    Helpful = 5pts,.
    Correct = 10pts

    :-)

    Check the sticky thred:
    http://forums.Oracle.com/forums/Ann.jspa?annID=939

    Welcome to the community, pls help others!

  • I have a problem with an error in windows media center: ERROR VIDEO files needed to display video are missing or corrupt.

    The error is: ERROR VIDEO files needed to display video are missing or corrupt.

    I Run Setup and restarted my computer at a later date.  I've always been unsuccessful.

    Can anyone help. Thank you

    Update your graphics card driver. Visit the manufacturer's Web site to download and install the latest graphics driver. Once proceed as follows: -.

    You must uninstall and reinstall the tv tuner card driver.

    1. start.

    2. in the start search box type:devmgmt.msc and press the Enter key.

    3. scroll sound, video and game controllers and expand it.

    4. right click on tv tuner card and uninstall it. Uninstall the device as software driver.

    5.reboot.

    6. visit the manufacturer's Web site to download and install the latest update and compatible tv tuner card tv tuner driver.

    7. now open Windows Media Center and re-run the whole upward.

  • Video error: the files needed to display video are not installed or not working not properly. Please restart Windows Media Center...

    Please help - it's driving me crazy! I got this to work!

    I am using Vista Ultimate and a connection (cat-5) ethernet to an xbox 360 as a Media Extender (via a Linksys router). I get the error of the video:
    "The files needed to display video are not installed or not working not properly." Please restart Windows Media Center or restart the computer "."

    I have a Happauge PVR 150 TV capture card installed, and you want to watch TV and my video files Via the Xbox 360. I can see the guide for lists of TV programs, but not to look at them without getting the message above.  I can also put in place a program to record, display the video thumbnail, but not play. Video files only will play are videos very select few years recorded only where there is.

    My graphics card is an ATI 2900XT - 512 MB of ram, with the latest drivers.

    I've seen a number of discussions on the web that describes the same (or similar) problem, but none of them seem to have no solution.

    I had Norton Internet Security installed and it has since withdrawn because of the firewall. I had thought, it could be a firewall issue, but it is not. I'm now using the Windows Firewall for now.

    I deleted and reinstalled the Xbox as an Extender media several times... no help. I have re-installed the complete drivers for the video capture card, it has not helped either. I checked and double-checked the settings on my router as well.

    The xbox is set for the share on my multimedia computer. The correct files can also be programmed for sharing.

    On the PC in Windows Media Center, I can view the TV programs, record programs etc etc etc all work.

    Any help would be really appreciated!

    Hello Lowwatts,

    Microsoft Xbox 360 community

    Thank you for visiting the website of Microsoft Windows Vista Community. The question you have posted is related to

    Microsoft Xbox360 community and would be better suited to the Microsoft's Xbox 360 community. Please visit the link below to find a community that will provide the support you want.

    Community Microsoft Xbox360

    Try following the steps in this article:

    Enjoy Windows Media Center on your Xbox 360 with your music, photos, recorded Live TV * and online media

    This should solve your problem.

    Let us know if these steps solve your problem.  I hope the information is useful.

    Kind regards

    Anthony
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Error: Files needed to display video are not installed or do not work properly. Restart WMC, or restart the computer

    Original title: windows media center

    I have reinstall Win 7 and finally managed to the precious WMC got the signal, channels, etc., but when I select all the channels I get this: "the files needed to display video are not installed or do not work properly. Restart WMC, or restart the computer. "I have resource disc and have re-install the drivers and utilities to the best of my limited knowledge. Help, please

    When I type in run in the start search box, it only pulls up "run programs for previous versions of windows" I can't run your steps without responding to this prompt.  What should I do if I can't follow your steps as you put it?

  • Problem with Windows Media Player: "Server execution failed" and "files needed to display video are not installed or do not work properly.

    I have a problem with Windows Media Player on laptop Lenovo G780. My laptop is under warranty (bought a month ago), but technical support Lenovo told me that the Windows Media Player program is not covered by the warranty.

    And this is a problem:

    When I click on Windows Media Player - to about 0.1 sec I see it opens and closes the window and nothing happens.

    When I select a mp3 or wmv file and right-click with the option open with Windows Media Player - I get a message: "Server execution failed" - I checked that all services with 'Media' in the name are running.

    When I select a mp3 or wmv file and right-click with the open option with Windows Media Center - Windows Media Center opens with the message: "the files needed to display video are not installed or do not work properly.

    When I select a file mp3 or wmv and right-click with option open with Windows Movie Maker life - see the video

    I tried to turn / WMP and WMC - did not help
    Tried to run as administrator - did not help
    I don't see something suspicious under events

    What can I do else?

    Thank you

    Zarek

    I had the same problem and then by chance, I tried a video on YouTube and it worked for me. Here's how I went on this issue and solved my problem:

    1. go to the computer, then OS (C).
    2. you will need to open Program Files (x 86) and Program Files.
    3. go to Windows Media Player in Program Files (x 86) and open the folder.  Then, remove the wmplayer file.  You may need to work around the error TrustedInstaller.  I'll tell you that, in a moment.
    4. in Program Files, go to the same folder for Windows Media Player and select the same file again. Wmplayer.  Copy the file in another window open.  Copy ensures that if the question comes up again you can at least try to fix it again.
    This should be the end of your problem.  If you need to circumvent the TrustedInstaller question is how:
    1. right click on wmplayer and select Properties > Security > advanced > owner > Edit > other users and groups.
    2. Enter your username and then click on check names.  Click OK.
    3. close the dialog boxes as he has requested.
    4. open again the properties and click Security.  Select your username from the list and click on edit.  From there, select full control.
    This should give you full control over the removal of the original file for WMP and easily allow you to copy the other files (x 86) programs.
    Please let me know how it goes for your problem.
  • WMC on Xbox 360 shows "video error: the files needed to display video are not installed...»

    Front when you use Windows 7 Xbox 360 everything has worked well.
    Upgrade to windows 8.  WMC can play programs recorded on PC, but when I try to play recorded shows with WMC of XBox 360, I get the following message

    "Video error: files needed to display video are not installed or not working not properly." "Please restart Media Center and or restart the computer.

    I don't have any codecs installed
    I tried regedit change suggested that for vista, does not work
    I tried the deactivation/activation of WMC on the PC, does not work
    Restart the PC does not work
    Restarting everything doesn't work

    had this error the other day, that it drove me crazy. You know what fixed it? Disable my firewall. For some reason, he decided to start blocking my xbox. I hope this helps.

  • The event log online help cannot be displayed because the default browser could not be started. Class not registered

    Hello. I live in Brazil, Rio de Janeiro and already installed W8 Pro original Microsoft license.

    When I need to use the event online Help Viewer, a reception this message - the event log online help cannot be displayed because the default browser could not be started.  Class not registered.
    Help, please.
    Thank you
    Carlos.

    Hi Carlos,

    Thanks for posting your query in the Microsoft Community Forums.

    After the description of the question, I understand that you are not able to access the online help for Event Viewer.

    1. do you receive an error message when you try to open the online help for Event Viewer?
    2. who is the default browser on your computer?

    Method 1:


    "The event log online help" her will bring you to the following Web page:

    http://www.Microsoft.com/technet/support/ee/ee_basic.aspx

    I suggest you try to access the above mentioned Web page to see if it works.

    Method 2:

    You can see the article mentioned below for how to set Internet Explorer as default browser.

    Make Internet Explorer your default browser

    http://Windows.Microsoft.com/en-us/Internet-Explorer/make-IE-default-browser#IE=IE-10

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you

  • I need to display the header in the second information page in pdf report using bi publisher

    Hello

    I need to display the header on the second page to leave information.

    I tried to use the fo:page - number of cases and does not work.

    Can you please help me find the solution?

    Thank you.

    Hello

    I found the solution. And it's resolved now.

    Just move the information necessary for the detail table and now it displayed each page if necessary.

    Thank you.

  • Need to display additional information to the hideshow in advanced table

    Dear all,

    I have a requiremnt as below.

    I have an advanced table and displaying data between a VO below and which, I need to display additional information after clicking on one of the field on the line.

    Basically, I need hideshow kind of features when you click a field in the row.

    Please help me on this

    Hello

    Fallow under steps it will work for you.

    Step 1: Select advanced table right click and create detail area for table advanced. (detail)

    Step 2: Create Message component provision under the detail Section. (DetailRN)

    Step 3: Add (point information) under DetailRN and correct view Instance and view attribute.

    Here's how structure component look.

    TableRN (advanced table)

    col1

    col2

    Components AdvancedTable

    in detail

    DetailRN

    COL3 (additional information)

    COL4 (additional information)

    Let me know any questions.

    Thank you

    Dilip

Maybe you are looking for