Issue with calculating Top 20 % in Query Designer

Hai
I am working on Query designer 7.0 where I need to design a report which has 4 parts. The first 3 parts displays the Items with Top 20 Inventory Value with 3 respective divisions for 6 months . Now the 4th part is to display Top 20% of inventory Value.
So in this report I need to take the Total Inventory and calculate the Top20 % of the items. Hence in this report I need to refer to the top 20 value of 3 divisions. So I cant jus give one condition. So I tried the replacement path for Items with restriction to other queries and created the variables. But I cant use these varaibles in the structures of rows or columns. It gives an error that this variable cant be used in Structure.
Please do help me in refering the top 20 values of 3 divisions for 6 months and do a calculation to display the % in my 4th report.
I will assign points for any kind of help provided

If you can design all those in One query than you can have it...
It seems now your aim is just to take result for 3 queries and use it in 4th query...
But if you can figure out defining all 3 Divisions and restriction in Same Query and then put the DISPLAY OPTION = HIDE = do not display
and then use their result to display you will achieve what you want to....
for e.g.
Jan 07-----Feb 07 -
Mar 07 -
Dec 07
Division 1-- Item 1 -
Inv 1 -
Inv1.........................DO NOT DISPLAY
Item2 -
Inv2 -
Inv2..........................DO NOT DISPLAY
Item3 -
Inv3 -
Inv3..........................DO NOT DISPLAY
<i><b>----
Item20 -
Inv20 -
Inv20</b></i>........................DISPLAY ONLY
Division 2-- Item 1 -
Inv 1 -
Inv1......................DO NOT DISPLAY
Item2 -
Inv2 -
Inv2........................DO NOT DISPLAY
Item3 -
Inv3 -
Inv3........................DO NOT DISPLAY
<b><i>----
Item20 -
Inv20 -
Inv20</i></b>....................DISPLAY ONLY
Division 3-- Item 1 -
Inv 1 -
Inv1</b>.......................DO NOT DISPLAY
Item2 -
Inv2 -
Inv2.......................DO NOT DISPLAY
Item3 -
Inv3 -
Inv3.......................DO NOT DISPLAY
<i><b>----
Item20 -
Inv20 -
Inv20</b></i>.........DISPLAY ONLY
THEN you will have result
Division -
Jan07 -
Feb 07 -
Marc 07
div1 -
Total inv/sum(top20) -
Total inv/sum(top20) -
Total inv/sum(top20)
div2 -
Total inv/sum(top20) -
Total inv/sum(top20) -
Total inv/sum(top20)
div3 -
Total inv/sum(top20) -
Total inv/sum(top20) -
Total inv/sum(top20)

Similar Messages

  • Issue with Broadcasting and Publish query to Portal from query Designer

    Dear all,
    I have created a standard template ZWT_STANDARD_TEMPLATE in WAD and I have added this for Adhoc Analysis in 'Set Standard Web templated' RSCUSTV27.
    For Broadcasting I have added 0BROADCASTING_TEMPLATE70.
    I have problems with my broadcasting as well as publishing the Query in Portal.
    When I use a Broadcast to Email - it opens a new window with my standard template(ZWT_STANDARD_TEMPLATE ) I have added. No data though.
    Same thing happens for publishing too...When I publish the query to portal from Query Designer or WAD it takes me to the same window with my standard web template. No data though.
    I think both are related to the same issue. Its with broadcasting.
    What is the default template for Broadcasting in NW2004s? Below is the url I have included when I do it from Query designer. Its actually starting the Command - START_BROADCASTER70 but I dont know if it has to do a SOURCE_QUERY=ZCOPA_C03_FAST_PAYABLES. Could anyone compare it with your urls
    http://pgdep00:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex3x?system=SAP_BW&CMD=START_BROADCASTER70&SOURCE_QUERY=ZCOPA_C03_FAST_PAYABLES&START_WIZARD=X&DISTRIBUTION_TYPE=PCD_EXPORT
    This is the url for publishing from WAD
    http://fndef00:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex3x?system=SAP_BW&CMD=START_BROADCASTER70&SOURCE_TEMPLATE=ZWT_FAST_PAYABLES&START_WIZARD=X&DISTRIBUTION_TYPE=PCD_EXPORT
    Any help would be highly appreciated.
    Thanks,
    KK

    Hi KK,
    Did you solve your problem, i am also having the same issue. Please let me know if you have solved this issue.
    Thanks,
    Kumar

  • Issues with Nested Tables and Adobe Designer

    Hi,
    I have some strange issues when I am trying to create a nested dynamic table with SAP DATA in Adobe Designer.
    My Outer Table has article items and in this table I got a nested charges. For instance the table contains this data:
    DATA
    |->Article1
    |--->charge111
    |--->charge211
    |
    |->Article2
    |--->charge122
    |--->charge222
    Now I am trying to display the data in a Adobe Designer table. But if I create a table with a row article and a repeating row charge all charges will be displayed under the first Article.
    This is the result:
    DATA
    |->Article1
    |--->charge111
    |--->charge211
    |--->charge122
    |--->charge222
    |
    |->Article2
    How can I solve this issue? I tried to select data binding on charges like article.DATA.charges.DATA[*] but this don't work.
    Anyone an idea?

    Alex,
    Is it print based form or interactvie form.
    ABAP
    If it is printbased form and if you are designing from SFP, you can use the following solution.
    You have to create a nested table in the context as below.
    say Table1-> Article ( fields: ARTICLENAME,....other fields) info Table2->cost info(fields:ARTICLENAME,Charge...,other fields).
    The 2 tables should contains data as beow.
    Table1 data.
    1row->Article1  -.....other values.
    2row->Article2  -.....other values.
    3row->Article3  -.....other values.
    Table2 data.
    1row->Article1  -Charge11 .....other values.
    2row->Article1  -Charge12 .....other values.
    3row->Article1  -Charge13 .....other values.
    4row->Article2  -Charge21 .....other values.
    5row->Article2  -Charge22 .....other values.
    6row->Article2  -Charge23 .....other values.
    7row->Article3  -Charge31 .....other values.
    8row->Article3  -Charge32 .....other values.
    9row->Article3  -Charge33 .....other values.
    In the context drag table2 into the table1 and define where clause on ARTICLENAME.
    In the layout drag nested table in the body page and make alignments.
    If your requirement is interactive, may be you can use the similar logic.

  • Conflict with text variable on Query Designer

    Hi,
    this is the scenario:
    - On Query Designer i got two restricted key figures: K1 and K2.
    - I'm usign a manual entered variable for 0CALMONTH.
    - On K1 the sales are restricted for the selected month.
    - On K2 the sales are restricted to a range between first month of the year, and the selected month-1.
    Then on a formula i use K1+K2 and a text variable (selected month) for the name of the column. Then, when running the query, the text for the variable can't be found. There is a conflict on text variable when using 2 restricted key figures on the formula.
    How can i solve it ?
    thx

    Hi,
    I assume that your text variable is of replacement type?
    If it doesn't work you can create a new text variable of user exit type and derive its value using entered 0CALMONTH.
    Best regards,
    Eugene

  • Issue with Read only VO Query bind parameters

    Hi Experts,
    Working in Jdev 11.1.1.3.0
    I am face one issue, probably its very common to all of us, bcoz i to do the same thing in N number of times.
    Issue:
    select count(*) as cnt from emp
    where
    ((:BindEmpId is NOT NULL AND EMP_ID = :BindEmpId) AND
    (DEPT_ID IS NULL OR DEPT_ID =: BindDeptId));
    when i run this query its giving correct result(count is 0) but usually i written like
    select count(*) as cnt from emp
    where
    ((:BindEmpId is NOT NULL AND EMP_ID = :BindEmpId) AND
    (BindDeptId IS NULL OR DEPT_ID =: BindDeptId));
    this time its giving count is 1, which is wrong.
    Data in data base:
    ID     DeptID     value EmpID
    226     1519     jh 601     
    So which one is correct?

    Well, the two select statements are for different use cases and we can't decide which is the correct one as we don't know the use case.
    Your data looks like
    ID   DeptID value EmpID
    226  1519   jh    601 There are some decisions we can't make with only one row in the table. We don't know if DepIt can be null in the table and/or EmpId can be null. This information is vital for your select statements.
    Next we don't know how you want to handle the query if one or both bind parameters are null.
    Should the query return 0 in this case or should the query just omit the part of the query if the bind variable is null (and then return the result found with the remaining query)?
    We can't possible answer this.
    You need to provide more information...
    Timo

  • Issue with Infoset of sap query

    Hi All,
    There is an existing 'z' Sap query and the inofet is created using  the data source 'Data retreival by program'(Data structure:BAPIEXPLOSIONLIST).
    I got the requirement to add onemore radiobutton(for Costing Run) to the selection screen of exsiting query and when the radio button is clicked on, it should display two more fields (Costing Run name and Costing Run date).So,I have added the below lines in the existing Infoset.
    1.Under the extras button and in data read program tab,I have added the below code for radio button and the two fields for selection.
    PARAMETERS p_cstrun LIKE jest-inact RADIOBUTTON GROUP cost.
    SELECT-OPTIONS sp_kaid FOR keko-kalaid  MODIF ID s1.
    SELECT-OPTIONS sp_kadt FOR keko-kaladat MODIF ID s1.
    2.Under the extras button and in code tab and in at seletion-screen output,I have added the below logic to enable those fields dynamically.
    LOOP AT SCREEN.
        IF p_CSTRUN EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.
          screen-invisible = 0.
          screen-active = 1.
          MODIFY SCREEN.
          elseif p_CSTRUN NE 'X' AND SCREEN-GROUP1 EQ 'S1' .
          screen-invisible = 1.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    After adding this,the existing selection-screen format has been changed.Please look at the below changes.
    ->Actually,there are two blocks in the existing screen with block titles.Now they are replaced with some different text
    ->And one more block for output format and under that the layout field selection was there in previous selection screen.Now this layout field text is changed to 'Sap Listviewer' and some butto has also come additionaly in the output format.
    How to retreive the old selection-screen with previous texts and formats.
    Can any one suggest to resolve the issue?
    Thanks in advance!!
    Best Regards,
    Mounika

    This is the complete code of selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK issel
                              WITH FRAME TITLE text-S01.
    SELECTION-SCREEN SKIP.
    PARAMETERS p_cstcur LIKE jest-inact USER-COMMAND ex DEFAULT 'X'  RADIOBUTTON GROUP cost .
    PARAMETERS p_cstfut LIKE jest-inact RADIOBUTTON GROUP cost.
    PARAMETERS p_cstprv LIKE jest-inact RADIOBUTTON GROUP cost.
    *Begin of Insert CBDK972000
    PARAMETERS p_cstrun LIKE jest-inact RADIOBUTTON GROUP cost.
    SELECT-OPTIONS sp_kaid FOR keko-kalaid  MODIF ID s1.
    SELECT-OPTIONS sp_kadt FOR keko-kaladat MODIF ID s1.
    *End of Insert CBDK97200
    SELECTION-SCREEN SKIP.
    PARAMETERS p_niv_g LIKE jest-inact DEFAULT 'X'.
    PARAMETERS p_niv_a LIKE jest-inact DEFAULT  ''.
    PARAMETERS p_niv_f LIKE jest-inact DEFAULT  ''.
    SELECT-OPTIONS sp_disgr FOR marc-disgr MEMORY ID lev NO-DISPLAY.
    SELECTION-SCREEN SKIP.
    PARAMETERS p_newfil LIKE jest-inact DEFAULT  ''.
    SELECTION-SCREEN END OF BLOCK issel.
    SELECTION-SCREEN BEGIN OF BLOCK csel
                              WITH FRAME TITLE text-s02.
    SELECT-OPTIONS sp_mtart FOR mara-mtart OBLIGATORY
      NO INTERVALS NO-EXTENSION MEMORY ID mta.
    SELECT-OPTIONS sp_werks FOR mbew-bwkey OBLIGATORY
      NO INTERVALS NO-EXTENSION MEMORY ID bwk.
    SELECT-OPTIONS sp_matnr FOR mara-matnr MEMORY ID mat.
    SELECTION-SCREEN END OF BLOCK csel.

  • Having issues with calculated dimension

    Hi,
    I just downloaded1.15 version of desktop Lumira and was trying to create a calculated dimension from and existing (but hidden) dimesion but Lumira just keeps spinning when I hit save in the formula editor.
    My formula is if {RDTE} > "04/223/2014" and {RDTE} < "05/13/2014" then "P05" else "NA".
    My diemnsion is a character set (ABC) but i also tried the same by converting to Date dimension with the same outcome.
    Anyone else has similar experience. I find the help document lacking in details. Any insights much appreciated...RND

    Hi Rumy
    Not that there should be any excuse for why saving would spin (that is an issue in itself that should be investigated), I recently had to do a similar date comparison and I used the following formula.
    if DateDiffInDays({Deal End Date}, {Deal Plan End Date}) > 0
    then "Delayed"
    else "Closed"
    I have not had a chance to compare if the results would work the same if I compared the two days as you did. Just wanted to share this in case it might be useful.

  • Problem with exceptions in the query designer

    Hi all,
    i got this problem, there is a formula, than calculate  "A"   %A   "B", This bring a value %, ok.
    in my exceptions i got this ranges:
    1  to  99,4  Bad 9
    99,5 to 100  Good 1,
    i execute the query and this bring the results, when there is a line with value 99,5, this appear without color, the rest is ok,
    why this happend? whats the solution? please guys, i'll award you

    i m sorry the values are
    0 to 99,4 Bad 9
    99,5 to 100 Good 1
    i solve it by this way
    0  to 99,49999999999  Bad 9
    99,5000000001 to 100 Good 1
    i looks like the internal value of the KF is with a lot of decimal, the problem here is, when the value is 99,5 exactly, dont appear color, but i dont know how else solve it, any advice?

  • Issue with calculation of planned cost.

    Hi,
    Can anybody explain me the s_alr_87013127 report. I am going to implement the PP orders process in plant.
    After creating and releasing the order the planned price in the report is displayed as per below
    In the above screen shot SMH cost is getting update in plan cost debit and material cost maintained as per in material master is getting update in plan cost credit. Please explain me why it is happening so that further analysis can be done.
    The material type is HALB and it is not going to be sale to customer. The settlement category against the order is also maintained as MAT as per below screen shot.
    Hence, the order is not settled through KO08 instead of that it is direct issue from stock through MVT Type 901 and against that cost is booked to its respective cost center as per below screen shot.
    Please explain me why only plan credit cost is captured instead of considering the both plan credit & debit cost.
    Regards,
    Samrat

    Hi Owen,
    Thanks for reply. My problem is that i am producing a semifinished material but not selling it and even it have no BOM & routing. Producing and capturing all its material cost and  SMH cost in plan cost, then issuing it from Sloc. & settling its cost to cost center through 901 mvt. type.
    Hence, when i am going to settle it then only the material cost is getting settle in the cost center. Also, please explain me that is it a standard scenario where always plan cost credit will considered material cost & SMH cost will considered as plan cost debit.
    As per my study the calculation of plan cost credit & plan cost debit is as per below.
    Plan Cost Credit = Actual qty. X Standard price
    Plan Cost Debit = Plan qty. X SMH hour booked in routing X Activity rate
    Please explain
    Regards,
    Samrat

  • Issue with product tops not moving after Upgrade Filesystem installed

    All:
    I have just installed the R12 tech stack and db in preparation for the upgrade. After this is completed it (rapidwiz) creates an environment file in $APPL_TOP. My issue is that some of the products, based on this environment file, still point to the 11i structure. There are about 10 products which have this issue. What should be done. Any suggestions are appreciated. I have pasted some of the ones that are still pointing to the old structure:
    AMF_TOP=/mnt/rd4/oracle/devappl/amf/11.5.0
    GRAPHICS60_PATH=/mnt/rd4/oracle/devappl/au/11.5.0/graphs
    CSS_TOP=/mnt/rd4/oracle/devappl/css/11.5.0
    JTS_TOP=/mnt/rd4/oracle/devappl/jts/11.5.0
    Here are some that are pointing to the correct location:
    INV_TOP=/mnt/rd4/app/dev/apps/apps_st/appl/inv/12.0.0
    IEC_TOP=/mnt/rd4/app/dev/apps/apps_st/appl/iec/12.0.0
    AMS_TOP=/mnt/rd4/app/dev/apps/apps_st/appl/ams/12.0.0

    kirkladb wrote:
    All:
    I have just installed the R12 tech stack and db in preparation for the upgrade. After this is completed it (rapidwiz) creates an environment file in $APPL_TOP. My issue is that some of the products, based on this environment file, still point to the 11i structure. There are about 10 products which have this issue. What should be done. Any suggestions are appreciated. I have pasted some of the ones that are still pointing to the old structure:
    AMF_TOP=/mnt/rd4/oracle/devappl/amf/11.5.0
    GRAPHICS60_PATH=/mnt/rd4/oracle/devappl/au/11.5.0/graphs
    CSS_TOP=/mnt/rd4/oracle/devappl/css/11.5.0
    JTS_TOP=/mnt/rd4/oracle/devappl/jts/11.5.0
    Here are some that are pointing to the correct location:
    INV_TOP=/mnt/rd4/app/dev/apps/apps_st/appl/inv/12.0.0
    IEC_TOP=/mnt/rd4/app/dev/apps/apps_st/appl/iec/12.0.0
    AMS_TOP=/mnt/rd4/app/dev/apps/apps_st/appl/ams/12.0.0Make sure that all these TOPs are set properly in the R12 appliction context file and in all env files under $APPL_TOP directory.
    Also, make sure that the 11i env file is not sourced in the applmgr user's profile (i.e. .bash_profile).
    Thanks,
    Hussein

  • Issue with result set of query

    I have the following tables:
    --soccer.soccer_optical_player_gm_stats
    --This is only sample data
    GAME_CODE    PLAYER_ID    NUMBER_OF_SPRINTS
    88884               84646                    55              
    88884               64646                    15  
    88884               55551                    35
    88884               88446                    10
    etc...--soccer.soccer_optical_team_gm_stats
    --This is only sample data
    GAME_CODE    TEAM_ID
    88884               13
    88884               13
    88884               15
    88884               13
    etc...--customer_data.cd_soccer_schedule
    --sample data
    GAME_DATE                     5/2/2009 7:30:00 PM
    GAME_CODE                     88884              
    GAME_CODE_1032                     2009050207
    HOME_TEAM_ID_1032              13
    HOME_TEAM_ID                     5360
    HOME_TEAM_NAME                     Los Angeles
    HOME_TEAM_NICKNAME             Galaxy
    HOME_TEAM_ABBREV                LA
    AWAY_TEAM_ID_1032              15
    AWAY_TEAM_ID                     5362
    AWAY_TEAM_NAME                     New York
    AWAY_TEAM_NICKNAME          Red Bulls
    AWAY_TEAM_ABBREV               RBSo using the tables above i'm trying to sum the number of sprints for each team and output it...
    With the following code:
    select          distinct
                     sch.game_date,
                     tm.team_id,
                     sch.game_code,
                     sch.game_code_1032,
                     sch.home_team_id_1032,
                     sch.home_team_id,
                     sch.home_team_name,
                     sch.home_team_nickname,
                     sch.home_team_abbrev,
                     sch.away_team_id_1032,
                     sch.away_team_id,
                     sch.away_team_name,
                     sch.away_team_nickname,
                     sch.away_team_abbrev,
                     home_tm_sprints,
                     away_tm_sprints
           -- bulk collect into distance_run_leaders
            from 
                     customer_data.cd_soccer_schedule sch,
                     soccer.soccer_optical_team_gm_stats tm,
                           select distinct
                                  sum(plyr.number_of_sprints) as home_tm_sprints,
                                  sch.game_code,
                                  sch.home_team_name,
                                  sch.away_Team_name,
                                  sch.game_code,
                                  rank () over (order by sum(plyr.number_of_sprints) desc) as rankings_order_home
                           from
                                  soccer.soccer_optical_player_gm_stats plyr,
                                  soccer.soccer_optical_team_gm_stats tm,
                                  customer_data.cd_soccer_schedule sch
                           where  sch.season_id = 200921
                           and    tm.team_id = sch.home_team_id
                           and    sch.game_code = plyr.game_code
                           group by
                                  sch.game_code,
                                  sch.home_team_name,
                                  sch.away_Team_name,
                                  sch.game_code
                           order by rankings_order_home asc
                      ) home_team,
                        select distinct
                               sum(plyr.number_of_sprints) as away_tm_sprints,
                               sch.game_code,
                               sch.home_team_name,
                               sch.away_Team_name,
                               sch.game_code,
                               rank () over (order by sum(plyr.number_of_sprints) desc) as rankings_order_away
                        from
                               soccer.soccer_optical_player_gm_stats plyr,
                               soccer.soccer_optical_team_gm_stats tm,
                               customer_data.cd_soccer_schedule sch
                        where  sch.season_id = 200921
                        and    tm.team_id = sch.away_team_id
                        and    sch.game_code = plyr.game_code
                        group by
                               sch.game_code,
                               sch.home_team_name,
                               sch.away_Team_name,
                               sch.game_code
                       order by rankings_order_away asc
                    ) away_team
            where    sch.game_code = tm.game_code
            and      sch.season_id = 200921Issues:
    1. The output above returns multiple entries(like 30 or so) for each game_code (i only want two entries returned for each game_code).
    --(Only difference between the two result sets is the team_id, which ultimatly lets me know if it a result for the home or away team)
    Something like:
    GAME_DATE                     5/2/2009 7:30:00 PM        5/2/2009 7:30:00 PM
    TEAM_ID                                13                                  15 
    GAME_CODE                     88884                             88884                  
    GAME_CODE_1032                     2009050207                    2009050207
    HOME_TEAM_ID_1032               13                                  13  
    HOME_TEAM_ID                     5360                               5360
    HOME_TEAM_NAME                     Los Angeles                      Los Angeles
    HOME_TEAM_NICKNAME           Galaxy                              Galaxy
    HOME_TEAM_ABBREV               LA                                   LA
    AWAY_TEAM_ID_1032             15                                   15
    AWAY_TEAM_ID                     5362                               5362
    AWAY_TEAM_NAME                     New York                        New York
    AWAY_TEAM_NICKNAME               Red Bulls                         Red Bulls
    AWAY_TEAM_ABBREV                  RB                                  RB
    HOME_TM_SPRINTS                    152                                152
    AWAY_TM_SPRINTS                   452                                 4522. In addition to that, I'm also having an issue trying to figure out how to do a general ranking...in the from clause i'd so a seperate ranking for just the home teams and just the away the teams. I can't seem to figure out how to merge the rankings into one, and just have one general ranking.
    Edited by: user652714 on May 7, 2009 4:18 PM
    Edited by: user652714 on May 8, 2009 7:14 AM

    ok maybe I just need to give you a better understanding of what i'm trying to ultimatly do, and maybe that will help clarify things.
    In the original code I posted the following subquery in the from clause...
    select distinct
                                  sum(plyr.number_of_sprints) as home_tm_sprints,
                                  sch.game_code,
                                  sch.home_team_name as home_team_name,
                                  sch.game_code,
                                  rank () over (order by sum(plyr.number_of_sprints) desc) as rankings_order_home
                           from
                                  soccer.soccer_optical_player_gm_stats plyr,
                                  soccer.soccer_optical_team_gm_stats tm,
                                  customer_data.cd_soccer_schedule sch
                           where  sch.season_id = 200921
                           and    tm.team_id = sch.home_team_id
                           and    sch.game_code = plyr.game_code
                           group by
                                  sch.game_code,
                                  sch.home_team_name,
                                  sch.away_Team_name,
                                  sch.game_code
                           order by rankings_order_home asc the result set was this...
        HOME_TM_SPRINTS     GAME_CODE           HOME_TEAM_NAME                  GAME_CODE                  RANKINGS_ORDER_HOME
         576                 870988                New York                   870988                     1
         480                 870991                Chicago                 870991                     2
         435                 870945                 Chicago                 870945                     3
         416                 870983                 San Jose                 870983                     4
         402                 870961                 D.C.                 870961                     5
         322                 870972                 Columbus                 870972                     6
         236                 870957                 Columbus                 870957                     7
         215                 870986                 Kansas City                 870986                     8
         143                 870984                 Los Angeles                 870984                     9Here is the other subquery that i had originally posted:
      select distinct
                               sum(plyr.number_of_sprints) as away_tm_sprints,
                               sch.game_code,
                               sch.away_team_name away_team ,
                               sch.game_code,
                               rank () over (order by sum(plyr.number_of_sprints) desc) as rankings_order_away
                        from
                               soccer.soccer_optical_player_gm_stats plyr,
                               soccer.soccer_optical_team_gm_stats tm,
                               customer_data.cd_soccer_schedule sch
                        where  sch.season_id = 200921
                        and    tm.team_id = sch.away_team_id
                        and    sch.game_code = plyr.game_code
                        group by
                               sch.game_code,
                               sch.home_team_name,
                               sch.away_Team_name,
                               sch.game_code
                       order by rankings_order_away ascResult rest:
       AWAY_TM_SPRINTS                    GAME_CODE                AWAY_TEAM        GAME_CODE           RANKINGS_ORDER_AWAY
         483                     870972                     Chicago                     870972                                1
         435                     870945                     New York                870945                           2
         430                     870986                     D.C.                     870986                                3
         429                     870984                     New York                870984                           4
         402                     870961                     New England            870961                             5
         384                     870988                     San Jose                870988                           6
         320                     870991                     New England            870991                             7
         208                     870983                     Chivas USA                870983                           8
         118                     870957                     Colorado                870957                           9Final output that I want/trying to get
    TM_SPRINTS  GAME_CODE    TEAM           GAME_CODE       RANKINGS_ORDER
    576          870988          New York          870988          1
    483          870972          Chicago          870972          2
    480          870991          Chicago          870991          3
    435          870945          Chicago          870945          4
    435          870945          New York     870945          4
    430          870986          D.C.          870986          6
    429          870984          New York     870984          7
    416          870983          San Jose     870983          8
    402          870961          D.C.          870961          9
    402          870961          New England     870961          9
    384          870988          San Jose     870988          11
    322          870972          Columbus     870972          12
    320          870991          New England     870991          13
    236          870957          Columbus     870957          14
    215          870986          Kansas City     870986          15
    208          870983          Chivas USA     870983          16
    143          870984          Los Angeles     870984          17
    118          870957          Colorado     870957          18The above is what i'm going for...but if it's to difficult to merge the columns into one (instead of having a seprate column for home_team_* and away_team_* that's fine to.
    Edited by: user652714 on May 11, 2009 9:04 AM

  • Issue with calculation script - please help

    There is a script that I am working on that needs to track the changes made by the user on the data form and push the entered value down proportionally to the lower levels.
    It’s a signal dimensional spread. It needs to spread the parent level values entered by the users for the product dimension to below levels. The Products are in rows.
    The issue is that the users can enter their data at any level for the product dimension i.e. either at Level 0 product members, Level 1 product members or at Level 2 product members. I am using two accounts A & B in sync to track the changes made.
    The structure of Product dimension that shows up on the form is similar to this –
    ~ Products (The user can enter starting at this level and also the below levels)
    ~ Product A
    ~ Product A1 (Level 0)
    ~ Product A2 (Level 0)
    ~ Product A3 (Level 0)
    ~ Product B (Level 0)
    ~ Product C (Level 0)
    ~ Product D
    ~ Product D1 (Level 0)
    ~ Product D2 (Level 0)
    This is what I came up with so far but it’s not working in all the cases yet. Please give your suggestions to modify this script further to make it work the right way.
    FIX(P, Y, H, E, B, D, C, V, C, S, @Relative(“Products”,-1))
    Account(
    IF(“AccountA”->@Parent(@Currmbr(“Product”)) <> “AccountB”->@Parent(@Currmbr(“Product”)))
    AccountA=AccountB->@Currmbr(“Product”)/AccountB->@Parent(@Currmbr(“Product”)))*AccountA ->@Parent(@Currmbr(“Product”));
    ENDIF;
    ENDFIX;
    FIX(P, Y, H, E, B, D, C, V, C, S, @Relative(“Products”,0))
    Account(
    IF(“AccountA”->@Parent(@Currmbr(“Product”)) <> “AccountB”->@Parent(@Currmbr(“Product”)))
    AccountA=AccountB->@Currmbr(“Product”)/AccountB->@Parent(@Currmbr(“Product”)))*AccountA ->@Parent(@Currmbr(“Product”));
    ENDIF;
    ENDFIX;
    This is not working right in all cases and I am sure I am going wrong somewhere. Please let me know your ideas on how can this be achieved.
    Thanks in advance.
    -Krrish
    Edited by: 928844 on Apr 19, 2012 11:23 AM

    Well... sort of fixed it.  Apparently my system doesn't like editing images with a color depth of 16bit.  If I convert it down to 8 when I'm converting it from RAW, then it allows me to add layers... Is this normal?
    Thank you for your time,
    -Tony

  • Issue with using SHUTTLE in query where clause

    Lets say we have a shuttle control on the page with the following 4 values: apple:orange:peach:berry
    Lets say I also have a simple SQL query report on the page and I want to use between 1 and 4 of the aforementioned values as part of an "*IN LIST*" sql operation. For example, if the user has selected only apple and orange from the shuttle, I want my query to be:
    select * from some_table where fruit IN ('apple', 'orange');
    if however, the user has selected all 4 fruits, the query should then read:
    select * from some_table where fruit IN ('apple', 'orange', 'peach', 'berry');
    I will add the dilemma that I do not want to convert this query to become a PL/SQL based report. Rather, I want to leave it alone as a SQL Query. My initial attempt was to create a hidden item on the page and use APEX_UTIL.STRING_TO_TABLE with a loop to convert the shuttle data to a comma separated list. This worked great, however when I use the this hidden item in my query, it doesn't work properly. I hope I am explaining this well, but when I populate this hidden item, I will get something like this.
    apple,orange
    Great. Lets say the hidden item above is called P7_HIDDEN_VALUE (for example). I then try to reference it in my query, and here is the problem:
    select * from some_table where fruit IN (:P7_HIDDEN_ITEM)
    Do you see the problem. The item resolves itself to be apple,orange, when it really needs the quotes to be *'apple','orange'*
    Help!!!!

    Hi,
    This post might help
    How to enable user to pick which row without using filter in interact. rpt?
    Or Bens blog post
    http://munkyben.wordpress.com/2010/11/16/handling-aggregated-strings-in-sql-reports/
    Regards,
    Jari

  • Having issues with calculations multiplying a field by 20.

    I am trying to find a correct formula that takes my field 'Quantity7' and multiplies it by 20. I have tried different forms and it always gives me an answer of 1.
    Quantity7 is the sum of quantities 1-6, is that where the issue is? I am so lost!

    Thanks Robert! I ended up using this formula after reading your reply and a
    few others. Another tip I was missing is to make sure that the calculated
    field is read only.
    // Get first field value, as a number
    var v1 = +getField("Quantity1").value;
    // Calculate and set this field's value to the result
    event.value = 20 * (v1 + 0);
    On Wed, Sep 10, 2014 at 2:29 AM, Robertlopez <[email protected]>

  • Issue with Results from Another Query (Error on Null value)

    Hi All,
    We have a WebI report using "Result from Another Query" option of BO XI R3.1. The report was running fine till recently the dimension object using result from another query had a null value. Report suddenly throwed error as the query filters are invalid.
    Is there a way to make this filter optional if no data/null value is there ? Because we need those null values in report as well.
    Thank you for your time.
    Thanks & Regards
    LN

    Hi Vivek,
    It was not directly solved but I applied alternate logic to over come the issue.
    Here's what I did to overcome:
    I used a sub query in place of the whole result from another query.
    For Ex:
    Dim1 inlist result from another query1
    I made it as
    Dim1 inlist (Dim0)
    where Conditions.
    Here Dim0 is the object which we use for Result from another query and Conditions will be the necessary filter conditions to arrive proper Dim0.  Make sure proper context is formed for the sub query.
    Even though it resolved my problem, It introduces an new issue. It causes increase in query run time when huge set of data is returned from sub query.
    Please let me know if i haven't explained clearly.
    Hi Aris_BO,
    Sorry for not responding earlier.  The logic would probably make more queries null & not null. Thats why I was not advised to use it.
    Thanks
    LN

Maybe you are looking for