TWO QUERIES IN REPORT

there are two queries in my report q-1 and q-2
q-1 shows all the selling of shares by client
q-2 show all the buying of shares from client.
now i have parameter with values
BUY
SELL
ALL
i want when i select buy only 2nd query records show on report mean buying of client
and vice versa for sell..
if select all then both queries record show on report mean buying and selling of client ..
how to do this .pplz help

it`s ok now its working ..
no plz tell me if on selecting all my result is like
sale of share: based on first query
member 76
client share rate
a 100 123
b 1200 111
member 77
client share rate
f 100 123
z 200 111
Purchase of share ----- from 2nd query
member 76
client share rate
x 100 123
y 1200 111
member 79
client share rate
f 100 123
z 200 111
-------------------------------------------------------------------if i want to display like in my report
member 76
sale against 76 ---based on first query
purchase against 76 -- based on 2nd query
member 77
sale against 77 ---based on first query
purchase against 77 -- based on 2nd query
can i do this in format trigger...

Similar Messages

  • Merging two Queries in single crystal report lauout

    Hi All,
    I need to show two reports from two different BEx queries in a single crystal report layout. The queries are independent of each onther and having their selection variables. I have implemented two subreports for two queries in a main report. Now the problem i am facing is, though both the queries are having same slection(Profit Centre and Fiscal Per/Year), they are getting repeated in crystal report parameter screen. I have to enter the values for selections for each report.
    Is there any method to merge the selections for both reports if they are same, so that i can enter the selections only once?
    Thanks in Adv,
    Shubhramukta.

    Hi,
    I have two queries in BEx having Selections. Query 1 is having selections (Profit centre and Fiscal Per/Yr) and query 2 is having same selections as well(i.e. Profit centre and Fiscal Per/Yr). I have created two reports corresponding to these queries have used as subreports in a main report using Crystal report 2008. When i run the main Crystal report, it automatically prompts for values to be entered, as variables are set at BEx query level.
    Though both the reports are having same selection variables, crystal report asks to enter values two times , once for each report, and it is obvious.
    Parameters are Crystal parameters.
    Is there any method to merge the parameters,is selection variables are same, so that it will ask only once?
    Thanks

  • Report with Two Queries -- Really need your Help Guys

    I might be posting duplicate thread but i couldnt found the Q&A that i am looking for.
    I am trying to create a report where i have to use two query. Also, with this query i am passing parameter where i ask user to enter Report Month so they can run report by what ever month they want to see data.
    Now my Q_2 is duplicate or Q_1 because in my final report layout i have to display fields where i have to compare current_month_data to Previous_month_data. so basically i want user to in put current month date and previous month date and layout look like.
    Company_Name Currentmonth_sale previousMonth_Sales ....
    Honda $1423.42 $324.42
    Toyota $3433 $4255.45
    so on....
    Now so far i create report manualy and drop two query in to the report but when i trying to create Report Wizard and group by each Company.. it is not giving me the out put that i want. Instead of giving me above out put its give me my Q_! result with each company group and then under that result i have Q_2 result.
    so HOW CAN I DISPLAY FIELDS FROM MY Q_2 WITH MY REST OF THE FIELD ON Q_1?????????????????????????
    Thank You guys.

    Actually, I tried to use Data Link but i am not able to success.
    Let me know if I am doing anything wrong . i click on left hand side tool panel where its says DATA LINK. then i click on Q_1 field and then drag the mouse over to Q_2 query with same field name. but its give me an error that Can not link it because of Group data and i have option to choose Yes, NO or Cancel.
    Let me know what are the step i need to take in order to link this two queries.
    Thank You
    keyun

  • Drill down in report based on two queries

    Hi,
    I have a problem with drilling down in report which is based on two queries.
    Queries are based on different universes.
    Both queries contains almost the same dimensions but different measures.
    In my report is a calculated measure based on measures from both queries.
    In both universes are the same hierachies.
    When I drill down in report for the first time I have to chose hierarchy  but then data are filtered to the choosen  value only from one query , data from second query are not filtered and the values of calculated measure are incorrect
    How can I solve this issue without adding dimensions belonging to the hierarchies to queries.
    Please help.
    Regards.
    MG

    Hi MG,
    First of all, what do you mean by "Both queries contains almost the same dimensions but different measures"
    "Almost" is not a good word in the IT world, especially when trying to merge/join tables. You need to be exact.
    That sounds like a possible reason for the problem.
    I am also not sure about your question:
    "How can I solve this issue without adding dimensions belonging to the hierarchies to queries."
    You may have to add those dimensions to the queries. Why would you not want to?
    Thanks

  • Report Designer - place two queries side by side in a report.

    I have a need to place two queries side by side in a report, I get a message that it is not possible to insert all fields.  What I am doing is placing each query in a report section and then trying to move the fields from one section to the previous section.  I am not sure if I am doing this correct.  Can someone let me know if this is possible and if so what am I doing incorrectly?  Thank you for your time and assistance!

    Hi Margaret,
    It is possible to display two queries side by side in a report.
    You just need to adjust the layout by dragging the each query along side each other - as you want to see it in the output.
    There is no need to move individual fields.
    Hope this helps!
    Regards,
    Saurabh

  • Confused on syntax-combine two queries

    I have two queries that I'm trying to combine, but can't figure out how to combine them ... successfully!?! The first query is pretty simple in that I'm looking at several fields from two different tables, no big deal.
    The second query calculates the years, months, days between two dates that are used in the first query. I'm stumped on how to combine the queries so that they place nice with each other and return results.
    Here's the first query ...
    select
    RTRIM(RTRIM(vpi.LastName) + ', ' + RTRIM(ISNULL(vpi.FirstName,''))) Employee,
    convert(varchar,vpi.FromEffectiveDate,101) PositionStart,      
    convert(varchar,vpi.ToEffectiveDate,101) PositionChange,
    convert(varchar,vpi.PositionStartDate,101) PositionStartDate,
    vpi.PositionReason, vpi.PositionCode, vpc.PositionCodeDescription
    from vhrl_positioninfo vpi
    inner join position_codes vpc on vpi.PositionCode = vpc.PositionCode
    Here's the second query ...
    select
    [Age] = convert(varchar, [Years]) + ' Years ' +
              convert(varchar, [Months]) + ' Months ' +
              convert(varchar, [Days]) + ' Days',     *
    from
         select
              [Years] = case     when BirthDayThisYear <= Today
                        then datediff(year, BirthYearStart, CurrYearStart)
                        else datediff(year, BirthYearStart, CurrYearStart) - 1
                        end,
              [Months]= case     when BirthDayThisYear <= Today
                        then datediff(month, BirthDayThisYear, Today)
                        else datediff(month, BirthDayThisYear, Today) + 12
                        end,
              [Days]= case     when BirthDayThisMonth <= Today
                        then datediff(day, BirthDayThisMonth, Today)
                        else datediff(day, dateadd(month, -1, BirthDayThisMonth), Today)
                        end,
              Birth = convert(varchar(10) ,Birth, 121),
              Today = convert(varchar(10), Today, 121)
         from
              select     BirthDayThisYear =
                   case     when     day(dateadd(year, datediff(year, BirthYearStart, CurrYearStart), Birth)) <> day(Birth)
                        then     dateadd(day, 1, dateadd(year, datediff(year, BirthYearStart, CurrYearStart), Birth))
                        else     dateadd(year, datediff(year, BirthYearStart, CurrYearStart), Birth)
                        end,
                   BirthDayThisMonth =
                   case      when      day(dateadd(month, datediff(month, BirthMonthStart, CurrMonthStart), Birth)) <> day(Birth)
                        then     dateadd(day, 1, dateadd(month, datediff(month, BirthMonthStart, CurrMonthStart), Birth))
                        else     dateadd(month, datediff(month, BirthMonthStart, CurrMonthStart), Birth)
                        end,
              from
                   select     BirthYearStart = dateadd(year, datediff(year, 0, Birth), 0),
                        CurrYearStart = dateadd(year, datediff(year, 0, Today), 0),
                        BirthMonthStart = dateadd(month, datediff(month, 0, Birth), 0),
                        CurrMonthStart = dateadd(month, datediff(month, 0, Today), 0),
                   from          
                        select birth = convert(datetime, fromeffectivedate) ,
                        Today = case when convert(datetime, toeffectivedate) = '3000-01-01'
                                       THEN convert(datetime, convert(int,getdate()))
    else vpi.toeffectivedate
    end
         from vHRL_PositionInfo vpi inner join position_codes vpc
                        on vpi.PositionCode = vpc.PositionCode
                   ) aaaa
              ) aaa
         ) aa
    )a
    Here's the sample data ...
    vpi table ...
    LastName FirstName FromEffectDate ToEffectDate PosStartDate PosReason PosCode
    Doe John 2001-10-15 3000-01-01 10-15-2001 Transfer OperPack
    Smith Tom 1994-11-28 2001-10-14 1994-11-28 New Hire OperDC
    vpc table ...
    PosCode PosDescription
    OperPack Pack Line Operator
    OperDC Descaler Operator
    This is what the results should look like ...
    John, Doe 2001-10-15 3000-01-01 10-15-2001 Transfer OperPack Pack Line Operator 6 Years 11 Months 16 Days
    John, Doe 1994-11-28 2001-10-14 1994-11-28 New Hire OperDC Descaler Operator 6 Years 6 Months 19 Days
    I know the date calculation piece adds 5 additional fields to the end, but they are not needed for the final report. Any help would be greatly appreciated! Thank you! Jena

    Your query suggests you're not using Oracle. Please post in your relevant database forum.

  • How to combine two queries in one EXCEL

    hi i got one requirement
    i got one excel sheet  from user which contains two  report s(hoe we know whether it is worknook or not) of  2011 data and now user wants 2012 data .now i icluded jan 2012 to dec 2012 in two reports and sent to user.But user is asking these two reports want to see in one sheet.
    so how can i proceed: if i go for work  book  how can i include these two reports in workbook and here my doubt is if i create a workbook based on  these two querie which name i have to give user.Please help me out on the same.
    Regards,
    Madhu.

    Hi Madhu
    Run one query. Click on a empty space in the excel
    From the BEx Design Toolbar -
    >Insert Analysis Grid -
    > Right click on the Design Item
    Edit the DataProvider.....You can ran same or different query with selection. 
    Save the result
    Check this link for detail....I am also searching for something with screenshot
    Regards
    Anindya
    Edited by: Anindya Bose on Feb 14, 2012 3:04 AM

  • How do I connect two Queries?

    Hello all,
    How do I connect two Queries and add some numbers.
    Here is what I am trying to do.
    Query 1: Gets G/L Credit Amounts for Jan 2007  Feb 2007 March 2007.....Dec 2007
    Query 2: Gets G/L Debit Amounts for Jan 2007 Feb 2007 march 2007.....Dec 2007
    I need to put both these Queries in a worksheet one below the other and add the totals by each month.....so the final report looks something like this:
    I am using two structures to hold the query values.
    G/L Credit Amount        Jan 2007    Feb 2007.............Dec 2007
                                        +100         +200                   +400
    G/L Debit Amount           -50           -100                     -200
    Total                              50             100                      200
    Also, I would like to allow the users to enter Year as a variable. Any suggestions?
    Your help is greatly appreciated.

    Venkata,
    Thanks for your reply. Could you explain how I insert two query results into one worksheet? And, also how do I link the two structures ( one structure per query) so I can total the amounts by each month?
    Thank you in advance.

  • Two Queries in one Worksheet

    Hi,
    I'd like to know what the disadvantages are of having two queries in the same worksheet of a workbook. Is it correct that the results of one query can overflow to the area of the second? How about issues with authorization, are there any?
    Thanks!

    HI,
    Yes, result of one can flow over the other if you are using simple report with characteristics and output may vary.
    Actually you apply basic Excel logic and its like 2 diff report on it.
    Mostly you add more Fixed format reports to a single sheet. So that  number of report rows dont increase and also you dont have any free characteristics to drilldown.
    About authorization, that depends on individual reports. If a user doesnt have proper authorization for 1 of the reports then that report would throw error while other would show result.

  • 0PA_C01  different results from two queries on the same cube ....

    HI
    Can you please help with this  problems ...
    i am running a two queries with the same restrictions e.g
    Sep 08 for employee 22345 ,
    In one report it shows the Pay Scale level as A1 , then in the other report it shows Pay scale Scale level as A2  ,
    looking  at the master data in 0employee  , the first report is right ... this is how the data looks like in 0employee
    Employee  Valid from      To                Pay scale Level
    222345       2007-11-03   2008-09-30     A1
    222345       2008-10-01   9999-12-31     A2
    Can someone please shed some light on this , im thinking it has something to do with update rule but even that is supposed to use last date of the month , not 1st day of the following month. The Cube is a stndard cube 0PA_C01 and the update rule aswell .....

    Hi,
    Please check in the cube whether the data for the Employee is getting with two values like shown in your question:
    Employee Valid from To Pay scale Level
    222345 2007-11-03 2008-09-30 A1
    222345 2008-10-01 9999-12-31 A2
    and also check whether when the data loaded to the cube.
    There may be some change in the report structure where the difference is getting may in the column wise or row wise restriction may present.
    Please check on the structure of the report also.
    With Regards,
    Ravi Kanth

  • Two querybex Crystal Reports Enterprise

    good afternoon,
    My question is this
    You can have more than two sources of data, rather
    two querybex, crystal reports in Enterprise?
    thanks

    Hi,
    You cannot create a report against multiple BEx queries. You can, however insert a sub-report that reports off another BEx query.
    -Abhilash

  • Merging the output of two queries in to one

    Dear experts,
    There are two reports generated with sap queries.
    I want some of the fields of first query to be displayed in to second.
    Is there any option for merging two queries.
    Where is the request of the query saved.
    How to do the changes in the query and how to transport it after changes.
    How to find the user group and infoset of the query.
    Please help me.

    Please serach in this forum, u can find lot of threads
    /people/shafiq.rehman3/blog/2008/06/16/sap-adhoc-query-sq01-sq02-sq03

  • Linking two queries

    I am having trouble linking two queries in my data table. The first query finds the maximum of a certain set of information, has the breakorder set at asending and orders them by a set of numbers in that query. A coordinate (ie. x and y) field is based off this maximum. In the other query, another maximum and coordinate are found and should be ordered by the same thing as in the first query (set of number in asending order). Instead of this happening, it prints all the numbers (not just the max) and the cooresponding coordinates for that number. I think that it has something to do with the queries not being linked properly. I would like to figure out what and where to link these queries (the whole report is based off a common id number).
    Thanks!

    If you're getting everything (as opposed to just the maximum) then I would suspect that it's your where clauses, or groupings, that are at fault (select max(x), y from <table> group by y should only return one row per y).
    However, it's pretty hard to determine what's going on with your descriptions - could you provide a couple of simplified queries and describe how they're linked, and it might be easier for everyone to figure out what's going on.
    Thanks,
    Danny

  • Simple Queries on Reports

    Hi, I have some simple queries on reports, which are following. Any help is appreciated!!
    Q1. Where does following information go ??
    a. The heading that I want to print on only the first page of the Report, like Report Name,
    Company name, should go to Margin or Header or Body ?
    b. Where does the page numbers go ?
    c. Field titles/labels, that should print on the beginning of every page of the report
    Q2. How can I restrict the printing of a cloumn to once, when a same value is repeating more than once.
    This is the first column of the report, so if it's value is same in the next rows, i need to print it only once.
    Should I use format trigger or that can be simply done my setting some properties ? If format trigger,
    then how ?
    Q3. Is it possible that I have two parameters in my Parameter Form and after accepting first parameter
    value I show the the list of second parameters on the basis of first value choosen by the user ?
    e.g. If somebody chooses dept# 10, and then second field displays all the employees of dept# 10.
    Q4. Im my report, I want always a last page that is dipalying data from altogether different query which is no
    way related to my other main query. This is query is pretty simple and I just want to display the
    data always on the last page of the report. How would I handle the layout of this page ??
    Thanks!!
    Shalu

    Hi Shalu,
    Q1-
    a)If you want to Print heading on the First Page ONLY then it sholud be
    in MAIN SECTION/BODY olny.(Fields Property- Print OBject On- Should be
    First Page).
    b)Bottom-Right of the MARGIN Section.
    c)if Report Heading is in Main Section then in the layouts Main Frame,
    inside that you can keep (Field titles/labels).
    Q2- Go to Report Wizard try these two Report Style(Group Above and Group Left)
    i think this will solve your Problem...
    Q3- I thinnnnnnnk this is not possible.
    Q4- You can use Trailer Section of the Report.
    Regards,
    Ravi

  • Combining two Queries

    Query 1 show me a list of users, each user should tell me how many orders, how many row, and total amount they placed <b>for a certain date</b>.
    Query 2 show me again a list of user, each user should me how many orders and how many row they placed <b>excluding that date above that are still open</b>.
    I would like these two queries to show on one report.  Is it possible?
    Query 1:
    SELECT COUNT(DISTINCT T0.UserSign) AS 'Today_order',
    COUNT(T1.PickStatus) AS 'Today_row', SUM(T1.Price *
    T1.OpenQty) AS 'Today_amount' FROM  [dbo].[RDR1] T1
    INNER JOIN [dbo].[ORDR] T0 ON T1.DocEntry = T0.DocEntry
    WHERE <b>T0.DocDate = CONVERT(DATETIME, '20051109', 112)</b>
    AND  T1.OpenQty > 0
    Query 2:
    SELECT COUNT(DISTINCT T0.UserSign) AS 'Other_order',
    COUNT(T1.PickStatus) AS 'Other_row' FROM  [dbo].[RDR1]
    T1 INNER JOIN [dbo].[ORDR] T0 ON T1.DocEntry =
    T0.DocEntry WHERE T1.OpenQty > 0  AND  <b>T0.DocDate <>
    CONVERT(DATETIME, '20051109', 112)</b>

    Hi Laura,
    It's probably easiest to use temporary tables or a cursor for this query.
    This code works for me (in SQL Query Analyzer and SBO):
    set nocount on
    create table #users (UserSign int, UserName nvarchar(30))
    create table #today (UserSign int, Today_row int, Today_amount numeric(15, 2))
    create table #other (UserSign int, Other_row int)
    insert  into #users
         select T0.USERID, T0.U_NAME from OUSR T0
    insert into #today
    SELECT DISTINCT T0.UserSign AS 'Today_order',
    COUNT(T1.PickStatus) AS 'Today_row', SUM(T1.Price *
    T1.OpenQty) AS 'Today_amount'
    FROM [dbo].[RDR1] T1
    INNER JOIN [dbo].[ORDR] T0 ON T1.DocEntry = T0.DocEntry
    WHERE T0.DocDate = CONVERT(DATETIME, '20051109', 112)
    AND T1.OpenQty > 0
    GROUP BY T0.UserSign
    insert into #other
    SELECT DISTINCT T0.UserSign AS 'Other_order',
    COUNT(T1.PickStatus) AS 'Other_row' FROM  [dbo].[RDR1]
    T1 INNER JOIN [dbo].[ORDR] T0 ON T1.DocEntry =
    T0.DocEntry WHERE T1.OpenQty > 0  AND  T0.DocDate <>
    CONVERT(DATETIME, '20051109', 112)
    GROUP BY T0.UserSign
    set nocount off
    select T0.UserSign, T0.UserName, isnull(T1.Today_row, 0) as Today_row,
         isnull(T1.Today_amount, 0) as Today_amount,
         isnull(T2.Other_row, 0) as Other_row
    from
         #users T0 left outer join #today T1 on T0.UserSign = T1.UserSign
         left outer join #other T2 on T0.UserSign = T2.UserSign
    drop table #users
    drop table #today
    drop table #other
    I've added the user name from the OUSR table to make the query a bit easier to understand.
    Hope this helps,
    Owen

Maybe you are looking for

  • How do I create an interactive PDF file with variable data

    We would like to basically do a 'mail merge' of our list of customers with an interactive PDF file (including videos, menus, etc - not just form fill out and web links) to create a single PDF file that contains multiple mail pieces ... one for each c

  • ORA-01023: Cursor context not found (Invalid cursor number)

    hello guys. when i'm trying to make a regular recover, i get this error: RMAN> run 2> { 3> restore database; 4> recover database; 5> alter database open; 6> } Starting restore at 09-MAR-07 RMAN-00571: =================================================

  • Iweb site for use with my own hosting company, not .mac

    Hello, What I would like to do is setup a photo album site in iweb but export it to ftp to my own hosting company. I noticed on a link found here that if you do so you lose the ability to have a slideshow......will this effect the ability for a perso

  • Missing 3G Due to Dummy AT&T Staff

    just wanted to share that after not being able to access the internet and realizing i wasn't receiving any messages (i could see if someone called), i took the phone into att&t. i had recently upgraded my program and in that process, the clerk had ac

  • Selecting node in af:treeTable

    Hi! My task is to alter custom selection function on af:table and make it work for treeTable. Make current method I took from this tutorial http://www.oracle.com/technetwork/developer-tools/adf/learnmore/25-generic-tree-selection-listener-169164.pdf