SUMCT result in query is incorrect!!!

Hi,
I am using the function SUMCT which is expected to give the sum of the values existing in the column in question...
I had used this function to one of the CKFs and when i cross check it the values are not matching...
sysntax was SUMCT 'CKF' as we normally do ...

Hi Simran,
in 3.5 you can work with formula variables to get the same results as documented in the "how-to paper".
--> Create Formula Variable
Type: Replacement Path
InfoObject: e.g. Region
Replace with "Attribute Value" -> Constant 1
If you have your formula  Price x Amount add multiplication by the Formula Variable:
Price x Amount x Formula Variable
This forces the OLAP to calculate the formula on the assigned level (Region) and not on the aggregated level of the sum.
Hope this helps,
best regards,
Dennis
Edited by: Dennis Schuster on Apr 1, 2009 6:05 PM

Similar Messages

  • Inconsistent SDO_RELATE results when querying 2.5D data

    Oracle 11.1.0.7 with Patch 8343061 on Windows Server 2003 32bit.
    I'm getting inconsistent results from SDO_RELATE results when querying 2.5D data. Some geometries I expect to be OVERLAPBDYDISJOINT, are not always being returned by SDO_RELATE when using the OVERLAPBDYDISJOINT mask. It seems that the order of the tables makes a difference to the result.
    Here's a table with one 2.5D geometry and a 2D index:
    CREATE TABLE TEST1 (
    ID                NUMBER PRIMARY KEY,
    GEOMETRY     SDO_GEOMETRY);
    INSERT INTO TEST1 (id, geometry) VALUES (
    1,
    SDO_GEOMETRY(3002, 2157, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(561695.935, 834005.726, 25.865,
    561696.229, 834005.955, 25.867, 561686.278, 834015.727, 26.088, 561685.179, 834019.771, 26.226, 561680.716, 834022.389, 26.226,
    561674.434, 834025.125, 26.171, 561671.963, 834032.137, 25.667, 561670.832, 834037.185, 25.619, 561667.946, 834042.976, 25.84,
    561666.717, 834047.218, 26.171, 561664.229, 834051.781, 26.778, 561660.041, 834055.935, 26.64, 561657.514, 834061.742, 26.53,
    561658.59, 834067.116, 27.882, 561657.67, 834070.739, 28.821, 561653.028, 834073.777, 29.042, 561653.234, 834078.769, 28.379,
    561658.336, 834080.105, 29.511, 561664.582, 834079.468, 31.94, 561669.257, 834075.821, 33.707, 561672.716, 834074.456, 33.707,
    561676.875, 834077.262, 33.735, 561675.868, 834081.55, 33.707, 561673.131, 834087.641, 33.679, 561672.208, 834093.502, 33.238,
    561668.578, 834100.894, 33.735, 561666.013, 834106.399, 33.679, 561661.408, 834111.23, 33.514, 561654.854, 834117.181, 33.486,
    561651.695, 834122.292, 33.569, 561649.112, 834128.847, 33.431, 561645.982, 834134.786, 33.293, 561642.485, 834141.235, 33.072,
    561642.138, 834150.085, 33.293, 561646.072, 834159.721, 36.578, 561647.274, 834165.532, 37.02, 561646.359, 834170.867, 37.02,
    561645.42, 834175.485, 36.799, 561642.44, 834180.977, 36.826, 561638.677, 834185.419, 36.771, 561636.693, 834194.824, 37.158,
    561635.462, 834202.105, 37.241, 561631.998, 834208.745, 37.268, 561628.871, 834213.994, 37.241, 561627.554, 834220.393, 37.82,
    561625.79, 834226.697, 39.532, 561620.561, 834236.494, 39.891, 561619.265, 834249.687, 39.697, 561619.883, 834260.02, 41.326,
    561620.977, 834264.399, 43.093, 561622.557, 834270.723, 43.452, 561622.172, 834276.978, 43.452, 561621.347, 834285.541, 43.479,
    561622.214, 834292.055, 43.645, 561619.718, 834302.583, 43.755, 561616.762, 834316.47, 43.755, 561608.842, 834328.241, 43.7,
    561606.346, 834334.93, 43.7, 561605.27, 834341.929, 43.7, 561603.925, 834350.648, 43.728, 561602.462, 834358.405, 43.838,
    561599.552, 834366.629, 44.031, 561594.551, 834374.291, 43.396, 561590.644, 834383.986, 43.065, 561588.48, 834392.21, 44.942,
    561586.923, 834397.32, 46.737, 561584.608, 834402.898, 49.299, 561581.389, 834410.194, 50.077, 561580.437, 834419.49, 51.907,
    561580.438, 834427.63, 53.127, 561582.245, 834433.389, 55.791, 561586.664, 834433.397, 57.503, 561593.88, 834433.608, 57.475,
    561596.305,834439.653, 57.42, 561591.804, 834445.862, 57.309, 561589.097, 834447.689, 57.014)));
    SELECT sdo_geom.validate_geometry_with_context(geometry, 0.0005) FROM TEST1;
    DELETE FROM user_sdo_geom_metadata WHERE table_name = 'TEST1' AND column_name = 'GEOMETRY';
    INSERT INTO user_sdo_geom_metadata VALUES ('TEST1','GEOMETRY', 
         MDSYS.SDO_DIM_ARRAY(
         MDSYS.SDO_DIM_ELEMENT('X',400000,750000,0.0005),
         MDSYS.SDO_DIM_ELEMENT('Y',500000,1000000,0.0005),      
         MDSYS.SDO_DIM_ELEMENT('Z',-10000,10000,0.0005)     
    ), 2157);
    DROP INDEX TEST1_SPIND;
    CREATE INDEX TEST1_SPIND ON TEST1(GEOMETRY) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('layer_gtype=line sdo_indx_dims=2');And here's another table with a 2D geometry and a 2D index:
    CREATE TABLE TEST2 (
    ID                NUMBER PRIMARY KEY,
    GEOMETRY     SDO_GEOMETRY);
    INSERT INTO TEST2 (id, geometry) VALUES (
    1,
    SDO_GEOMETRY(2002, 2157, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(561816.516, 834055.581, 561819.504, 834057.173,
    561817.942, 834060.818, 561810.044, 834078.997, 561805.576, 834087.634, 561801.572, 834094.299, 561798.558, 834100.467,
    561796.254, 834107.637, 561793.754, 834115.605, 561794.049, 834123.694, 561793.698, 834130.518, 561792.905, 834138.883,
    561787.867, 834145.772, 561782.544, 834150.548, 561777.707, 834156.53, 561773.945, 834161.32, 561771.061, 834166.957,
    561768.155, 834173.131, 561764.735, 834178.744, 561759.603, 834187.782, 561756.146, 834195.493, 561753.416, 834198.821,
    561754.141, 834205.691, 561756.768, 834209.681, 561757.217, 834216.701, 561753.086, 834232.46, 561744.371, 834254.589,
    561740.936, 834263.001, 561737.198, 834272.208, 561732.231, 834284.915, 561730.52, 834297.01, 561728.339, 834310.053,
    561727.825, 834328.069, 561730.461, 834342.992, 561729.808, 834367.948, 561730.216, 834396.988, 561732.273, 834419.047,
    561732.783, 834424.668, 561731.647, 834432.212, 561731.872, 834439.436, 561731.39, 834449.269, 561732.041, 834462.813,
    561733.583, 834471.926, 561733.229, 834485.049, 561730.868, 834498.462, 561726.379, 834512.59, 561725.776, 834528.932,
    561727.488, 834555.23, 561729.357, 834577.873, 561731.05, 834595.931, 561731.163, 834611.928, 561734.057, 834637.031,
    561732.67, 834636.4, 561725.401, 834633.796, 561721.039, 834632.493, 561718.777, 834632.167, 561710.437, 834632.888,
    561647.929, 834636.658, 561644.963, 834630.085, 561632.796, 834629.813, 561625.553, 834627.647, 561620.473, 834626.711,
    561608.718, 834624.94, 561599.935, 834619.684, 561596.67, 834613.843, 561594.27, 834607.774, 561592.513, 834601.752,
    561591.349, 834593.899, 561597.265, 834584.888, 561595.956, 834571.479, 561595.075, 834556.196, 561593.997, 834539.68,
    561594.316, 834528.071, 561595.261, 834516.44, 561595.538, 834504.804, 561597.227, 834497.417, 561599.3, 834490.416,
    561601.265, 834482.61, 561605.126, 834475.502, 561599.232, 834473.683, 561593.076, 834471.379, 561599.154, 834451.112,
    561589.097, 834447.689, 561591.804, 834445.862, 561596.305, 834439.653, 561593.88, 834433.608, 561582.245, 834433.389,
    561580.438, 834427.63, 561580.437, 834419.49, 561581.389, 834410.194, 561584.608, 834402.898, 561586.923, 834397.32,
    561588.48, 834392.21, 561590.644, 834383.986, 561594.551, 834374.291, 561599.552, 834366.629, 561602.462, 834358.405,
    561603.925, 834350.648, 561605.27, 834341.929, 561606.346, 834334.93, 561608.842, 834328.241, 561616.762, 834316.47,
    561619.718, 834302.583, 561622.214, 834292.055, 561621.347, 834285.541, 561622.172, 834276.978, 561622.557, 834270.723,
    561620.977, 834264.399, 561619.883, 834260.02, 561619.265, 834249.687, 561620.561, 834236.494, 561625.79, 834226.697,
    561627.554, 834220.393, 561628.871, 834213.994, 561631.998, 834208.745, 561635.462, 834202.105, 561636.693, 834194.824,
    561638.677, 834185.419, 561642.44, 834180.977, 561645.42, 834175.485, 561646.359, 834170.867, 561647.274, 834165.532,
    561646.072, 834159.721, 561642.138, 834150.085, 561642.485, 834141.235, 561645.982, 834134.786, 561649.112, 834128.847,
    561651.695, 834122.292, 561654.854, 834117.181, 561661.408, 834111.23, 561666.013, 834106.399, 561668.578, 834100.894,
    561672.208, 834093.502,561673.131, 834087.641, 561675.868, 834081.55, 561676.875, 834077.262, 561672.716, 834074.456,
    561669.257, 834075.821, 561664.582, 834079.468, 561658.336, 834080.105, 561653.234, 834078.769, 561653.028, 834073.777,
    561657.67, 834070.739, 561658.59, 834067.116, 561657.514, 834061.742, 561660.041, 834055.935, 561664.229, 834051.781,
    561666.717, 834047.218, 561667.946, 834042.976, 561670.832, 834037.185, 561671.963, 834032.137, 561674.434, 834025.125,
    561680.716, 834022.389, 561685.179, 834019.771, 561686.278, 834015.727, 561696.229, 834005.955, 561695.935, 834005.726,
    561677.805, 833994.91, 561683.163, 833985.817, 561703.01, 833949.434, 561725.891, 833961.856, 561744.35, 833971.197,
    561768.396, 833983.86, 561777.842, 833988.883, 561798.333, 833999.743, 561797.243, 834005.725, 561783.574, 834040.515,
    561798.127, 834046.391, 561807.001, 834050.509, 561816.516, 834055.581)));
    SELECT sdo_geom.validate_geometry_with_context(geometry, 0.0005) FROM TEST2;
    DELETE FROM user_sdo_geom_metadata WHERE table_name = 'TEST2' AND column_name = 'GEOMETRY';
    INSERT INTO user_sdo_geom_metadata VALUES ('TEST2','GEOMETRY', 
         MDSYS.SDO_DIM_ARRAY(
         MDSYS.SDO_DIM_ELEMENT('X',400000,750000,0.0005),
         MDSYS.SDO_DIM_ELEMENT('Y',500000,1000000,0.0005)
    ), 2157);
    DROP INDEX TEST2_SPIND;
    CREATE INDEX TEST2_SPIND ON TEST2(GEOMETRY) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('layer_gtype=line sdo_indx_dims=2');Now if I check how these two geometries relate to each other, the answer is OVERLAPBDYDISJOINT, which makes sense when inspecting the geometries.
    SQL> SELECT
      2  sdo_geom.relate(t1.geometry, 'determine', t2.geometry,  0.0005) relate_1_to_2,
      3  sdo_geom.relate(t2.geometry, 'determine', t1.geometry,  0.0005) relate_2_to_1
      4  FROM test2 t2, test1 t1
      5  WHERE t1.id = t2.id;
    RELATE_1_TO_2        RELATE_2_TO_1
    OVERLAPBDYDISJOINT   OVERLAPBDYDISJOINT
    1 row selected.So, I'd expect this query to return something...
    SELECT /*+ ORDERED */ t1.id, t2.id, sdo_geom.relate(t1.geometry, 'determine', t2.geometry,  0.0005) relate
    FROM test2 t2, test1 t1
    WHERE sdo_relate(t1.geometry, t2.geometry, 'mask=overlapbdydisjoint') = 'TRUE'
    AND t1.id = 1
    AND t2.id = 1;Nada. And this...
    SELECT /*+ ORDERED */ t1.id, t2.id, sdo_geom.relate(t1.geometry, 'determine', t2.geometry,  0.0005) relate
    FROM test1 t1, test2 t2
    WHERE sdo_relate(t2.geometry, t1.geometry, 'mask=overlapbdydisjoint') = 'TRUE'
    AND t1.id = 1
    AND t2.id = 1;Nada.
    And this...
    SQL> SELECT /*+ ORDERED */ t1.id, t2.id, sdo_geom.relate(t1.geometry, 'determine', t2.geometry,  0.0005) relate
      2  FROM test2 t2, test1 t1
      3  WHERE sdo_relate(t2.geometry, t1.geometry, 'mask=overlapbdydisjoint') = 'TRUE'
      4  AND t1.id = 1
      5  AND t2.id = 1;
            ID         ID RELATE
             1          1 OVERLAPBDYDISJOINT
    1 row selected.This version gives the right answer.
    Can anyone explain this?

    Hi,-
    I think you are running into these bugs 7158518 and 7710726.
    Could you please request the patch for the bugs so that they are published on Metalink
    if they dont exist there?
    Please let us know if these fix your problem.
    Best regards
    baris

  • Query Performance and Result Set Query/Sub-Query

    Hi,
    I have an infoset with as many as <b>15 joins</b> with different ODS and Master Data..<b>The ODS are quite huge with 20 million, 160 million records)...</b>Its taking a lot of time even for a few days and need to get atleast 3 months data in a reasonable amount of time....
    Could anyone please tell me whether <b>Sub-Query or Result Set Query have to be written against the same InfoProvider</b> (Cube, Infoset, etc)...or they can be used in queries
    on different infoprovider...
    Please suggest...Thanks in Advance.
    Regards
    Anil

    Hi Bhanu,
    Needed some help defining the Precalculated Value Set as I wasnt succesful....
    Please suggest answers if possible for the questions below
    1) Can I use Filter Criteria for restricting the value set for the characteristic when I Define a Query on an ODS. When i tried this it gave me errors as below  ..
    "System error in program CL_RSR_REQUEST and form  EXECUTE_VTABLE:COB_PRO_GET_ALWAYS....                     Error when filling value set DELIVERY..                                               
    Job cancelled after system exception ERROR_MESSAGE"                                           
    2) Can I create a create a Value Set predefined on an Infoset -  Not Succesful as Infoset have names such as "InfosetName_F000232" and cannot find the characteristic in Paramter Tab for Value Set in Reprting Agent.
    3) How does the precalculated value Set variable help if I am not using any Filtering Criteria and is storing the List of all values for the Variable from the ODS which consists of 20 millio records.
    Thanks for your help.
    Kind Regards
    Anil

  • Query SQ02 : restriction lines result of query

    Hi everybody,
        I have prb with a query. I have created a query and infoset. I have join tables .. and I would like to add condition of clause 'where' to restrict the result of query depending on the dates. Those dates are not given in the selection screen but depends on the results of a one table included in infoset.
    somebody has idea ?
    Thanks.
    Maya

    Hi,
    In the infoset you can write code to restrict the lines..
    GO to the infoset in change mode..
    click the extras button..
    click the code tab..
    choose the code section.."Records processing"
    In that you will have the table structures available...use the check statement to filter the data..
    Ex..
    CHECK VBAK-ERDAT = SY-DATUM.
    Thanks
    Naren

  • Exporting result of query to another input query (Write Cube )?

    Hello BI experts,
    Is it possible to send a result of a read cube / query to be saved into other write cube  / query ?
    If yes , how to do ?
    thx in advance

    Hello srini,
    I am tring to update ODS from a query as per your suggestion.
    But there is a Error
    ==========
    Error in the definition of the analysis process: See long text
    Node: Query 1
    The technical field name KYF_0002 for field 4CKMVZCDCO7A6PK7FT0GB7WCV may only appear once per input or output structure
    My quries is based on multiprovider and also has cell definition in it. Therefore i m not able to update result of query ods.
    what should be done?
    Thanks for your earlier siggestion.

  • Saving result from query into CSV file

    Hi folks,
    in our application we're generating pages source using general packages (like htp, owa_util, ...). and in this part I'm a really beginner.
    I want to modify source one of our page, I want to add functionality to enable save result from query (cursor) into CSV file, to enable user choose place where generated file will be created and also change file name.
    I searched this forum and I found procedure, that could be useful:
    procedure p_getcsv is
    cursor cur is
           select 'a1' col1, 'b1' col2, 'c1' col3 from dual
       union  select 'a2' col1, 'b2' col2, 'c2' col3 from dual
       union  select 'a3' col1, 'b3' col2, 'c3' col3 from dual;
       begin
            -- Set the MIME type
            owa_util.mime_header( 'application/octet', FALSE );
            -- Set the name of the file
            htp.p('Content-Disposition: attachment; filename="test.csv"');
            -- Close the HTTP Header
            owa_util.http_header_close;
            -- Loop through all rows in EMP
            for x in cur
            loop
                -- Print out a portion of a row,
                -- separated by commas and ended by a CR
                 htp.prn(x.col1||','|| x.col2||','||x.col3|| chr(13));
            end loop;        
       end;What peace of code should I add to procedure that is generating web page to enable calling this procedure and whole saving process?
    Can anybody help me with this?
    Many thanks,
    Tomas
    Message was edited by:
    Tomeo

    Hi Marc,
    thanks for reply, problem is that I'm not using APEX application, I'm just generating web page code straight using oracle general packages.
    But I found this solution (maybe some tunning will be good):
    In page where I want to display Download i have
      begin
             htp.anchor2 (
                           curl  =>  ... .p_getcsv'||'?term=2005&crn=123,
                           ctext => 'Download Class List'
             HTP.br;
          end;
    ...si I'm calling p_getcsv procedure:
      procedure p_getcsv( term  IN stvterm.stvterm_code%TYPE DEFAULT NULL,
                           crn   IN sirasgn.sirasgn_crn%TYPE DEFAULT NULL) is
       v_length      NUMBER;
       v_file_name   VARCHAR2 (2000);
       temp_blob  blob;
       line RAW(32767);
       begin
             DBMS_LOB.CREATETEMPORARY(temp_blob, TRUE);
             FOR i IN 1..6  LOOP
                line := UTL_RAW.CAST_TO_RAW(i||','||term||','||crn||',AAA,BBB,CCC'||chr(10));
                DBMS_LOB.WRITEAPPEND(temp_blob, LENGTH(UTL_RAW.CAST_TO_VARCHAR2(line)), line);
             END LOOP;
              v_file_name := 'ClassList.csv';
              v_length  := DBMS_LOB.getlength (temp_blob);
              -- set up HTTP header
                 -- use an NVL around the mime type and
                 -- if it is a null set it to application/octect
                 -- application/octect may launch a download window from windows
               OWA_UTIL.mime_header (NVL ('csv', 'application/octet'), FALSE);
               -- set the size so the browser knows how much to download
               HTP.p ('Content-length: ' || v_length);
               -- the filename will be used by the browser if the users does a save as
               HTP.p (   'Content-Disposition:  attachment; filename="'
                  || REPLACE (REPLACE (SUBSTR (v_file_name,
                                               INSTR (v_file_name, '/') + 1
                                       CHR (10),
                                       NULL
                              CHR (13),
                              NULL
                  || '"'
                 -- close the headers
                 OWA_UTIL.http_header_close;
                -- download the BLOB
                 WPG_DOCLOAD.download_file (temp_blob);
                 -- release temporary blob
                 dbms_lob.freetemporary(temp_blob);  
       end;Regards,
    Tomas

  • WEBI Sample Result Set Query Property Question

    Wnen I set the WEBI Sample Result Set query property my retrievals took longer than I thought they should especially with a limited result set.  When I hit the View SQL button and look at SQL I notice that the following order by is added to the query:
    Order by dbms_random.value
    I copied the query and ran it against our Oracle database with and without the order by.  Without the order by the query ran significantly faster.   Is there any way to stop the order by from being generated when the Sample Result Set property is set?
    Thanks,
    Bob

    Thanks for your reply.
    I tried to locate the parameter you mentioned in the parameters for my universe and did not find anything referencing not enforcing order bys.  I checked the documentation and did not see anything there either.   Please respond with the exact name of the parameter or if it is a custom parameter the settings you used to create it.
    Thanks,
    Bob

  • ADM Error processing results from query: Error: Index 0 out of range

    11.1.2.1
    When running quite a large book, we are getting the following error:
    ADM Error processing results from query: Error: Index 0 out of range
    The individual reports in the books are running fine.
    PS.  The report books that are giving this error run fine on 9.3.1
    Could this be a time-out issue and how do we resolve it?

    what is background datasource Essbase or HFM
    do you have lot of data in pov please try below
    >Do you have pov prompt
    >increase jvm heap size for report server in reporting server
    >Fr log files has some more detail

  • Sub Query or Use Result of Query on OLAP BW Universe ?

    Dear All,
    Could you use in Webi report  :
    1 ) Sub Query ? I activate the option with Designer but button is still in grey...
    2 ) Result of query on filter panel ? The button is still in grey
    Regards
    Cédric

    Hi ,
    I do it before my initial post... without success.
    I already use Sub Query in relational database, but with OLAP BW universe, I can't use actually...
    I am searching info, solution,...
    Thanks
    Cédric

  • BEx Query Providing Incorrect Results

    I have two BEx queries that are behaving strangely.
    They are providing incorrect results and I can't figure out why.
    In both cases, when I save query in development under a different technical name the problem disappear.   I can't use this as a permanent solution because users insert queries in workbooks and we have portal links.
    Is there a way to somehow  fix these queries that
    are acting strangely.
    Query 1:
    When run query get error message
    "No roll storage space of length 120 available fro OCCURS area"
    Query2:   Calculates Wrong Average
    When run query:
    Adding Cumulative Qty Customer Balance + Quantity Customer Movement
    together.
    Set Aggregation to Average
    ref char Posting Period.
    The avearge BEx calculates only considers  Cummulative Quantity
    End Customer Balance.  It should consider consider Quantity Customer Movement as well.
    Avg formula :  ((Jan End - (.5* Jan Mov) ) + (Feb End - (.5* Feb Mov))+   (Mar End -(.5* March Mov)))/3
    I have used the same  methodology to calculate average with other queries and it average calculates correctly.  These other queries have same InfoProvider and using the same dimensions as queries that are calculating average incorrectly.

    Hi Mti
    Thank you for your reply.
    I have checked the details as per your suggestion:
    1. KF Aggreagtion tab on Workbench Exception Aggregation is on SUM Summation.
    2. RKF on The Query is on (Nothing Defined).
    Is there anything else that can be checked?
    Thank you

  • Query Producing Incorrect Results

    Hello:
    I am trying to perform a number of queries on a database and
    although I am not receiving an error message; I know that the
    returned results are incorrect.
    For example, in my test data; I have only 1 record that
    matches the SchoolBoardID (Therefore the record could only have one
    grade, one gender, etc. yet my queries are returning results for
    both genders (Male and Female) and multiple grades (11 and 12) when
    the record in question actually has a grade 9 assignment.
    I have looked at my code over and over and I cannot find
    where the problem is; does anyone see anything that jumps out at
    them?
    I am using an MS-Access database and I have the following
    data types for the relevant fields in question.
    Field Name = SchoolBoardID - Numeric - Sample Data - 74
    Field Name = StudentTraineeGender - Data Type = Text - Sample
    Data - Either Male or Female
    Field Name = StudentTraineeGrade - Data Type = Text - Data
    Contains the following (9, 10, 11, 12, 12+ Hence the reason for
    having to use a Text data type)
    Field Name = SchoolYear - Data Type = Text - Sample Data -
    2006-2007
    Field Name = TradeCode - Data Type = Text - Sample Data -
    444A
    Field Name = TeacherWEAApproval - Data Type = Yes/No - Sample
    Data - 1 or 0
    <!--- Query The Database to find all Grade 11 Males Who
    Are Taking an Apprenticeable Trade --->
    <cfquery name="GetGrade11Males"
    datasource="MyDataSource">
    Select SchoolBoardID, StudentTraineeGender,
    StudentTraineeGrade, SchoolYear, TradeCode, TeacherWEAApproval From
    WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And StudentTraineeGender = 'Male'
    And StudentTraineeGrade = '11'
    And TradeCode <> '0000'
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfGrade11Males =
    #GetGrade11Males.RecordCount#>
    <!--- End Of The Query to find all Grade 11 Males Who Are
    Taking an Apprenticeable Trade --->
    <!--- Query The Database to find all Grade 12 Males Who
    Are Taking an Apprenticeable Trade --->
    <cfquery name="GetGrade12Males"
    datasource="MyDataSource">
    Select SchoolBoardID, StudentTraineeGender,
    StudentTraineeGrade, SchoolYear, TradeCode, TeacherWEAApproval From
    WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And StudentTraineeGender = 'Male'
    And StudentTraineeGrade = '12' Or StudentTraineeGrade =
    '12+'
    And TradeCode <> '0000'
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfGrade12Males =
    #GetGrade12Males.RecordCount#>
    <!--- End Of The Query to find all Grade 12 Males Who Are
    Taking an Apprenticeable Trade --->
    <!--- Query The Database to find all Grade 11 Females Who
    Are Taking an Apprenticeable Trade --->
    <cfquery name="GetGrade11Females"
    datasource="MyDataSource">
    Select SchoolBoardID, StudentTraineeGender,
    StudentTraineeGrade, SchoolYear, TradeCode, TeacherWEAApproval From
    WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And StudentTraineeGender = 'Female'
    And StudentTraineeGrade = '11'
    And TradeCode <> '0000'
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfGrade11Females =
    #GetGrade11Females.RecordCount#>
    <!--- End Of The Query to find all Grade 11 Females Who
    Are Taking an Apprenticeable Trade --->
    <!--- Query The Database to find all Grade 12 Females Who
    Are Taking an Apprenticeable Trade --->
    <cfquery name="GetGrade12Females"
    datasource="MyDataSource">
    Select SchoolBoardID, StudentTraineeGender,
    StudentTraineeGrade, SchoolYear, TradeCode, TeacherWEAApproval From
    WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And StudentTraineeGender = 'Female'
    And StudentTraineeGrade = '12' Or StudentTraineeGrade =
    '12+'
    And TradeCode <> '0000'
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfGrade12Females =
    #GetGrade12Females.RecordCount#>
    <!--- End Of The Query to find all Grade 12 Females Who
    Are Taking an Apprenticeable Trade --->
    <!--- Query To Find The Total Number Of Male Students
    Registered As Apprentices --->
    <cfquery name="GetMaleRegisteredApprentices"
    datasource="MyDataSource">
    <!--- End Of Query To Find The Total Number Of Male
    Students Registered As Apprentices --->
    Select SchoolBoardID, SchoolYear, StudentTraineeGender,
    TradeCode, RequestForMTCUByTeacher, ApprovedForMTCUByOYAP,
    TeacherWEAApproval From WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And TradeCode <> '0000'
    And StudentTraineeGender = 'Male'
    And RequestForMTCUByTeacher = 1
    And ApprovedForMTCUByOYAP = 1
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfMaleRegisteredApprentices =
    #GetMaleRegisteredApprentices.RecordCount#>
    <!--- Query To Find The Total Number Of Female Students
    Registered As Apprentices --->
    <cfquery name="GetFemaleRegisteredApprentices"
    datasource="MyDataSource">
    <!--- End Of Query To Find The Total Number Of Female
    Students Registered As Apprentices --->
    Select SchoolBoardID, SchoolYear, StudentTraineeGender,
    TradeCode, RequestForMTCUByTeacher, ApprovedForMTCUByOYAP,
    TeacherWEAApproval From WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And TradeCode <> '0000'
    And StudentTraineeGender = 'Female'
    And RequestForMTCUByTeacher = 1
    And ApprovedForMTCUByOYAP = 1
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfFemaleRegisteredApprentices =
    #GetFemaleRegisteredApprentices.RecordCount#>
    <!--- Query To Find The Total Number Of Male Students
    Registered As Apprentices Graduated--->
    <cfquery name="GetMaleRegisteredApprenticesGraduated"
    datasource="MyDataSource">
    <!--- End Of Query To Find The Total Number Of Male
    Students Registered As Apprentices --->
    Select SchoolBoardID, SchoolYear, StudentTraineeGender,
    TradeCode, RequestForMTCUByTeacher, ApprovedForMTCUByOYAP,
    Graduated, TeacherWEAApproval From WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And TradeCode <> '0000'
    And StudentTraineeGender = 'Male'
    And RequestForMTCUByTeacher = 1
    And ApprovedForMTCUByOYAP = 1
    And Graduated = 1
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfMaleRegisteredApprenticesGraduated =
    #GetMaleRegisteredApprenticesGraduated.RecordCount#>
    <!--- Query To Find The Total Number Of Female Students
    Registered As Apprentices Graduated--->
    <cfquery name="GetFemaleRegisteredApprenticesGraduated"
    datasource="MyDataSource">
    <!--- End Of Query To Find The Total Number Of Male
    Students Registered As Apprentices --->
    Select SchoolBoardID, SchoolYear, StudentTraineeGender,
    TradeCode, RequestForMTCUByTeacher, ApprovedForMTCUByOYAP,
    Graduated, TeacherWEAApproval From WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And TradeCode <> '0000'
    And StudentTraineeGender = 'Female'
    And RequestForMTCUByTeacher = 1
    And ApprovedForMTCUByOYAP = 1
    And Graduated = 1
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfFemaleRegisteredApprenticesGraduated =
    #GetFemaleRegisteredApprenticesGraduated.RecordCount#>
    Thank you for any assistance that you can lend me with
    resolving my query issues:
    Regards,
    Chizzy
    Cornwall, Ontario, Canada

    Hello:
    SchoolBoardID is unique in that there is only 1 record in the
    WEA_Registrants table containing it; however, it was my intention
    with my queries to have the potential for more that one query to
    have a positive recordcount. (i.e. It would be possible for
    #GetGrade11Males.RecordCount# and
    #NumberOfMaleRegisteredApprentices# and
    #NumberOfMaleRegisteredApprenticesGraduated# to all return positve
    record counts.
    quote:
    Sounds like there may be more to this issue than you are
    leading us to believe.
    To the best of my knowledge, I have presented
    all of the relevant information.
    I will look into the documentation on cfqueryparam.
    Thanks for your assistance.
    Regards,
    Chizzy

  • Addition of Key Figures in Query Produces incorrect Results

    Hi,
    I have a query with a globally defined structure of Restricted Key Figures. These are mainly G/L Account Balances from R/3.
    When I create a global Calculated Key Figure the sum is incorrect (ie does not match R/3) despite the fact that the individual restricted key figures match perfectly.
    The only inconsistency is one or 2 of the RKF's are + ve in R/3 but - ve in BW.
    Would really appreciate some help on this.
    Thanks a lot.

    Hi All,
    Thanks for your replies.
    Paul B - I tried your recommendation and it did not work. I only set the result to summation nothing else.
    Bjorn - I tried what you said but that didnt work either.
    Venkat - I thought about this but I have about 30 + Calculated Key Figs and over 100 Restricted Kfs and a fair amount have -ve signs. Do I have to do this for all ?
    Regards

  • Incorrect results in query

    Hi All,
    I've created a calculatedKF named 'Asset Cost' which is a sum of 6 KFs.
    I am using the same in my query as a 'New selection' with restriction based on a varaible on 'posting period'. Means if i give the posting period value as '8', i'll get the results only for posting period for this Calculated KF and not the sum of all posting periods.
    Now the issue is that once when the users started querying the result was appearing double to them though the query definition remained the same i.e no changes made to CKF etc.
    I regenerated the query as in RSRT or if i make some redundant changes to query(i.e putiing a characteristic out and then put in) the query once again gave the correct results.
    Can anyone tell me how the query results got doubled as this happened to me again and again i had to regenerate the queries?Full points to be awarded.
    It is to be noted that the users are using this calculated CKf in other queries with or without any restrictions on posting period.
    Thanks in advance,
    Ajay

    the CKF used in other queries doens't apply at all.
    don't fully agree with the point of the load and aggregates and so on: how frequent is your datarget loaded? is it a multiprovider? Does it have aggregates?
    Why don't you let the "calculate result as" with "Nothing Defined"?
    For the cache:
    what is the cache mode of your Qry? RSRT / properties...
    You can reset the the cache of this query just by resaving its definition.
    So:
    - save your query
    - run it and check the result. is it correct?
    - if not, drilldown some chars and find out which char makes it correct.
    please let me know if you still have the issue
    regards,
    Olivier.

  • Incorrect result in query

    Hi all,
    i have loaded data from PSA into DSO. I can see all the data correctly.The DSO is defined as part of a Multiprovider on which I have created a Query. When i call my query, i can see only 2 columns displayed correctly. if i include any other KF in my query definition, i dont see any output. Besides my output gives an aggregated display in the report unlike how the data exists in the DSO. Do i need to make any setting changes ? pls help.
    SD
    points will be awarded.

    Query output will be aggregated one.Its aggregated based on what you drilldown.
    I think only those two key figs are coming from that DSO.Check the identification for the key figs which are not populated in the multiprovider.
    Also check if there are any conditions in the query.The conditions used should be present in the DSO,I mean that field.
    Hope this helps.

  • Af:query working incorrectly in case of Match Any

    Hi,
    i am working on Oracle Jdeveloper 11g Release 1
    I am facing an issue with my adf query which is based on VO Criteria. The jspx block for query is:
    <af:query id="qryId2"
                      headerText="#{coregccomplianceuiBundle.COMPLIANCE_SEARCH}"
                      disclosed="false"
                      value="#{bindings.RuleLibraryVOCriteriaQuery.queryDescriptor}"
                      model="#{bindings.RuleLibraryVOCriteriaQuery.queryModel}"
                      queryOperationListener="#{bindings.RuleLibraryVOCriteriaQuery.processQueryOperation}"
                      queryListener="#{viewScope.rule_librarybean.processQuery}"
                      resultComponentId="::pc1:ruleLib" rows="3" maxColumns="2"
                      saveQueryMode="hidden"/>The VO criteria for this query is:
    <ViewCriteria
        Name="RuleLibraryVOCriteria"
        ViewObjectName="oracle.sysman.core.gccompliance.model.library.rule.view.RuleLibraryVO"
        Conjunction="AND"
        Mode="2">
        <Properties>
          <CustomProperties>
            <Property
              Name="displayOperators"
              Value="InAdvancedMode"/>
            <Property
              Name="autoExecute"
              Value="true"/>
            <Property
              Name="allowConjunctionOverride"
              Value="true"/>
            <Property
              Name="showInList"
              Value="false"/>
            <Property
              Name="mode"
              Value="Basic"/>
            <Property
              Name="displayName"
              ResId="DEFAULT_SEARCH"/>
          </CustomProperties>
        </Properties>
        <ViewCriteriaRow
          Name="vcrow3"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="RuleDnameTransient"
            ViewAttribute="RuleDnameTransient"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional">
            <CompOper
              Name="LessThan"
              ToDo="-1"
              Oper="&lt;"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="LessThanOrEqualTo"
              ToDo="-1"
              Oper="&lt;="
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThan"
              ToDo="-1"
              Oper=">"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThanOrEqualTo"
              ToDo="-1"
              Oper=">="
              MinCardinality="0"
              MaxCardinality="0"/>
          </ViewCriteriaItem>
          <ViewCriteriaItem
            Name="DescriptionTransient"
            ViewAttribute="DescriptionTransient"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional">
            <CompOper
              Name="LessThan"
              ToDo="-1"
              Oper="&lt;"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="LessThanOrEqualTo"
              ToDo="-1"
              Oper="&lt;="
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThan"
              ToDo="-1"
              Oper=">"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThanOrEqualTo"
              ToDo="-1"
              Oper=">="
              MinCardinality="0"
              MaxCardinality="0"/>
          </ViewCriteriaItem>
          <ViewCriteriaItem
            Name="IsSystem"
            ViewAttribute="IsSystem"
            Operator="="
            Conjunction="AND"
            Required="Optional"/>
          <ViewCriteriaItem
            Name="RuleType"
            ViewAttribute="RuleType"
            Operator="="
            Conjunction="AND"
            Required="Optional"/>
          <ViewCriteriaItem
            Name="TargetType"
            ViewAttribute="TargetType"
            Operator="="
            Conjunction="AND"
            Required="Optional"
            Value=":targetType"
            IsBindVarValue="true"/>
          <ViewCriteriaItem
            Name="KeywordsTransient"
            ViewAttribute="KeywordsTransient"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional"
            UpperColumns="0"/>
        </ViewCriteriaRow>
      </ViewCriteria>The query works fine when i select Match All radio button.
    But when i select Match Any radio button and click search it gives me incorrect search.
    As per my understanding Any will give union of multiple column search results, for example if i search for Column1= "ABC" and get 5 results and if i search Column2="XYZ" and get 3 results , if i select Match Any radio Button i hall get a union of both results.
    But in my case if one of the column used for search is a drop down selection and other column is a normal text box i am not getting correct results the results are only shown for dropdown search and the text box results are not shown.
    Can anyone suggest what am i missing here?

    no ignore null values field is checked.
    Can anyone suggest what am i missing?

Maybe you are looking for

  • I can't buy anything because itunes keeps timing out

    So I am trying to buy an album .... and I need to update my billing info .... so go to my account, then click change billing info and imediatly I am taken to a page where it says the connection timed out. I can't create a user and a box keeps popping

  • OIM 9.1 Pending task installing new conector

    Hello, I've been installed a new conector for SAP. I created a new Resource Object and some process defenition but I've two pending task in the installation: - Task name: Installation -- Organization: Requests - Task name: Enter Info into Oracle Iden

  • GL Line items

    Hi all, What type of transaction will create an entry in FIGL line items? I know when there is a goods receipt, an entry is created in figl line items. I would like to know what other transactions will create an entries. Thanks Annie

  • Using distribute to send and receive forms.... secure or not?

    As always I have browsed through and tried to find my answer and have not located exactly what I am looking for.  I have a PDF form that I want to distribute. When I distribute there are 3 options, the first option showing a lock which tells me it's

  • SelectionChange for enter and backspace keys

    Hello all, Our VSTO addin needs to know the current selection so we can sync our taskpane with current selection. We are using the SelectionChanged event to register our taskpane synch routine. The problem is that this event doesn't fire on Enter or