Combine queries: calculate a rate

< color = "#000080" > I'm working on a few reports on a BMC Remedy database in Oracle (for those who are familiar with BMC Remedy).
I need to calculate the rate of calls resolved for each user or agent in the last 24 hours. The time is stored in the format of the time unix / (60 * 60 * 24 is the number of seconds in a day).

I need to get < / make >

< pre class = "jive-pre" > < class ID = "java jive jive-code" >
SELECT submitter, 
  SUM(
                        CASE
                          WHEN (LAST_RESOLVED_DATE - REPORTED_DATE) &gt; (60*60*24) THEN 0
                          ELSE 1
                        END
                       )
   FROM  HELP_DESK
      WHERE REPORTED_DATE &gt;= (
                        select ((sysdate-to_date('1-1-1970 00:00:00','MM-DD-YYYY HH24:Mi:SS'))* (24*60*60))-(24*60*60*1) n from dual
                         )
        AND status &lt;= 4
        AND (LAST_RESOLVED_DATE - REPORTED_DATE) &lt;= (60*60*24)
        AND SUBMITTER = ASSIGNEE_LOGIN_ID
        AND (ASSIGNED_GROUP = 'CHQ-SERVICEDESK' OR ASSIGNED_GROUP = 'CHQ-Z-SERVICEDESK')
   GROUP by submitter
   order by 2 desc
{code}</code></pre>
<br />
<font color="#000080">and then divide it by<br />
</font>
<br />
<pre class="jive-pre"><code class="jive-code jive-java">{code:java}
SELECT submitter, 
  SUM(
                        CASE
                          WHEN (LAST_RESOLVED_DATE - REPORTED_DATE) &gt; (60*60*24) THEN 0
                          ELSE 1
                        END
                       )
   FROM  HELP_DESK
      WHERE REPORTED_DATE &gt;= (
                        select ((sysdate-to_date('1-1-1970 00:00:00','MM-DD-YYYY HH24:Mi:SS'))* (24*60*60))-(24*60*60*1) n from dual
                         )
   GROUP by submitter
   order by 2 desc
{code}</code></pre><font color="#000080">
Everything in the same query, and then get the top five users/agents which I suppose that can be done using:</font><br />
<br />
<pre class="jive-pre"><code class="jive-code jive-java">{code:java}
ORDER BY 2 DESC
AND ROWNUM &lt; 6
{code}</code></pre>
<br />
<font color="#000080">as you can see I'm a newbie.<br />
Any suggestions?<br />
I will really appreciate your help.</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

Still not tested because we do not have any table DDL...

SELECT *
  FROM (
        SELECT submitter,
               number_calls,
               resolved_calls,
               ROUND((resolved_calls/ number_calls),4) resolution_rate
          FROM (
                SELECT submitter,
                       SUM( CASE WHEN( (status <= 4) and
                                       (LAST_RESOLVED_DATE - REPORTED_DATE) <= (60*60*24) and
                                       (SUBMITTER = ASSIGNEE_LOGIN_ID) and
                                       (ASSIGNED_GROUP IN ('CHQ-SERVICEDESK','CHQ-Z-SERVICEDESK') ) )
                                 THEN 1
                                 ELSE 0
                             END ) resolved_calls,
               SUM(CASE WHEN (LAST_RESOLVED_DATE - REPORTED_DATE) > (60*60*24)
                                 THEN 0
                                 ELSE 1
                             END ) number_calls
              FROM help_desk
                 WHERE REPORTED_DATE >= ((sysdate-to_date('1-1-1970 00:00:00','MM-DD-YYYY HH24:Mi:SS'))* (24*60*60))-(24*60*60*1)
                 GROUP BY submitter
          )
     WHERE number_calls > 9
     ORDER BY 4 DESC
     )
WHERE rownum <= 5

Justin

Tags: Database

Similar Questions

  • How to calculate heart rate in a simple way using visa series

    I am new to Labview, it's my mini project title "PC based ECG monitoring. I have this mini album, part hardware circuit ECG and DAQ (MPLAB) who will be using Labview for graphical user interface. My problem is, I made the graph for the ecg monitoring, and I need to calculate the heart rate and to detect bradycardia and tachycardia. for bradycardia is more or equal to 100bpm and tachycardia is less than 60 BPM.  for the diasease 2, when it is either a bradycardia or tachycardia, the alarm lights.  I also have a problem to make the detection of peaks and mark all the peak maximum and minimum and put the location of the peak. Thank you. Here I set my vi.

    This is the complete...
    Thank you very much..

  • the time of acquisition of data - how to calculate the rate of analog output

    I want to calculate an acceptable rate of analog output, one that is taken in charge by material (PCIe6353), without the rate being changed by the VI DAQmx Timing (sample clock). The final objective is to have a rate of analog output that is an integer multiple of the analog input for precise frequency, since the sinusoid AO's amplifiers, which have a ringtone when AO updates occur.

    According to 27R8Q3YF of the knowledge base: how the actual scanning speed is determined when I specify the rate of scanning to My d..., the rate is revised as needed by calculating the rate of clock / asked for advice, divide the result rounded downwards and upwards in the clock of the Board and use the one that is closest to the requested speed.

    If 'Embedded clock' is selected, which is the result "Council clock.  DAQmx sample clock timebase Timing node - SampClk.Timebase.Rate says 100 ms/s. However, for a rate resulting from the update of 2.38095MS / s, the divisor of the time base timing node - "SampClk.TimebaseDiv" gives a value of 42. 42 x 2.38095 M = 99, 999, 990, where it should be 100 ms/s.

    How to calculate an acceptable rate of analog output is supported by the hardware? I have other plates, in addition, a general method would be appreciated.

    I haven't worked all the details yet but noticed a few things that may be relevant.

    Req AI rate isn't a whole ditch 1E8. It is used to determine the rate of the AO.

    There is no check to ensure that the rate of the AO is an integer division.

    It seems that you have the right idea, but the implementation is not yet there.

    Lynn

  • Combine queries to get the result set with max Y

    Hello
    I use forms 6i and db 10.2.0.1.0

    With the query below
    Select ufam_usrgrp,ufam_filegrp,ufam_read,ufam_write,ufam_overwrite,ufam_delete from usr_file_access_master
    Where ufam_ecode = '0004108';
    the result set is
    UFAM_USRGRP     UFAM_FILEGRP    UFA UFA UFA UFA
    --------------- --------------- --- --- --- ---
    MGMNT           CV              Y   Y   Y   Y
    EMPLOYEE        GENERAL         Y   N   N   N
    EMPLOYEE        PERSONAL        Y   N   N   N
    Another query
    Select uul_usrgrp, ufl_file_grp,ufl_read,ufl_write,ufl_overwrite,ufl_delete from usr_usrgrp_lnk,USRGRP_FILEGRP_LINK
    Where usr_usrgrp_lnk.uul_usrgrp = USRGRP_FILEGRP_LINK.UFL_USR_GRP
    and usr_usrgrp_lnk.uul_ecode = '0004108'
    gives the result
    UUL_USRGRP      UFL_FILE_GRP    UFL UFL UFL UFL
    --------------- --------------- --- --- --- ---
    MGMNT           GENERAL         Y   Y   Y   Y
    EMPLOYEE        GENERAL         Y   Y   N   N
    MGMNT           CV              Y   N   N   N
    I need to combine these two queries to get a separate result set with maximum Y

    Like here "MGMNT CV" is repeated in both the result set, but the first has more, then it should come from the combined result set. reverse-case also the same (such as "EMPLOYEE GENERAL")

    So I want to combine the queries so that I get the result as set below
    UserGroup       FileGroup       Rd Wrt Owrt Del
    --------------- --------------- --- --- --- ---
    MGMNT           GENERAL         Y   Y   Y   Y
    EMPLOYEE        GENERAL         Y   Y   N   N
    MGMNT           CV              Y   Y   Y   Y
    EMPLOYEE        PERSONAL        Y   N   N   N
    Please help me to combine these queries

    Published by: Divya on August 14, 2011 21:24
    Changed the result set and the last exit

    NOT TESTED!

    select y.uul_usrgrp,
           y.ufl_file_grp,
           greatest(ufl_read,nvl(ufam_read,' ')) ufl_read,
           greatest(ufl_write,nvl(ufam_write,' ')) ufl_write,
           greatest(ufl_overwrite,nvl(ufam_overwrite,' ')) ufl_overwrite,
           greatest(ufl_delete,nvl(ufam_delete,' ')) ufl_delete
      from (select ufam_usrgrp,ufam_filegrp,ufam_read,ufam_write,ufam_overwrite,ufam_delete
              from usr_file_access_master
             Where ufam_ecode = '0004108'
           ) x,
           (select uul_usrgrp, ufl_file_grp,ufl_read,ufl_write,ufl_overwrite,ufl_delete
              from usr_usrgrp_lnk,USRGRP_FILEGRP_LINK
             Where usr_usrgrp_lnk.uul_usrgrp = USRGRP_FILEGRP_LINK.UFL_USR_GRP
               and usr_usrgrp_lnk.uul_ecode = '0004108'
           ) y
     where y.uul_usrgrp = x.ufam_usrgrp(+)
       and y.ufl_file_grp = x.ufam_filegrp(+)
    

    Concerning

    Etbin

    Edited by: Etbin on 14.8.2011 13:08
    deleted by group

  • Issue of CAL script to calculate exchange rates

    Hi all experts,

    I'm new in Essbase, can someone help and tell me what is the problem with the following CAL script?

    I got 10 dimension
    -Account
    -Months
    -Year
    -Market
    -Product
    -Cost center
    -Currency
    -Version
    -Currency - USDvalue, EURvalue, etc.

    For downloading data, we will download either USD or value EUR, then based on the exchange rate for the month (also loaded as data), try to calculate the value in another currency


    / * GET EXCHANGE RATES * /.

    Fix (@LEVMBRS("3000000000",0), @LEVMBRS("Company",0), @LEVMBRS(Market,0),
    @LEVMBRS (product, 0), @LEVMBRS("Cost Centre",0), @LEVMBRS(Month,0),.
    @LEVMBRS(Year,0), @LEVMBRS("Version",0), @LEVMBRS(Currency,0))

    ("USDValue"
    IF (@ISMBR ("USD"))

    USDValue;
    ON THE OTHER
    EURValue / (@CURRMBR ("Year"))--> (@CURRMBR ("Month"))--> (@CURRMBR ('Version'))
    -> (@CURRMBR ("Currency"))-> "CTR_ACC"-> "MKT_HK"-> "PROD_TRY"-> "999999"-> "COM_1010"-->
    "RPT in EUR ex rate."
    ENDIF;
    )
    ENDFIX;
    CALC all;

    I got stuck after you run this script, thank you for your help in advace.

    try to create another data base of exchange rate
    then bind with the dimension of the year or with scenarios exchange rate

    You can link by changing the properties of the new database and access the currecny tab

    and these fill options

    later in the script to calc.

    Trouble (scenario of currency for the leave of dimension and year)
    DIFFICULTY ("currecny scenario", "FY09")
    Try CCONV "FY09"-> "USD".

    change your currency from USD regardless of u liked to watch for and in data download change the value of that currency 1

    Try this it will work like cake and in few seconds

  • combine queries instead of join

    do not take into account.

    Published by: Jay on January 20, 2011 08:12

    Jay wrote:
    1 oracle Database 10 g Express Edition Release 10.2.0.1.0 - product
    Sorry for others, as said, works by application right now, just want to combine without the help of the join.

    Providing others is going to be critical to get your question answered.

    Simplify your problem in the tables and columns that are needed. Then create some CREATE / INSERT scripts with a small, but a representative set of sample data.

    Finally, explain us how to get your final result (don't forget to include that as well). We do not understand your company, or do not forget that your data.

  • How to calculate the rate of data transfer if I know that the total number of samples/s?

    I'm looking to set a PXI system for measurement of County at high speed, routes, while that controlled remotely via MXI - 4.  How can I be sure that the controller is capable of rapid data transfer quite seen the number of channels and frequencies of sampling provided?

    I think I figured this out, but maybe someone can save me.  For the task at hand, I will have a PXI-4496 and four PXI - 6143 s all 32768 samples/s sampling.  4496 is 24-bit, and 6143 is 16-bit.  Thus,.

    bits of samples/s/channel x 24 16 channels x 32768/8 = 1 048 576 bytes / s

    +

    32 x 32768 samples/s/channel x 16 bits/8 channels = 2,097152 bytes/sec

    =

    3 145 728 bytes/s, or exactly 3 MB/s.

  • Join/to/where/combine queries

    Hello, I have this query in my CF program

    First query
    SELECT TLA_PROP. PIN, TLA_PROP. ASSR_PRCL_NBR, TCASE. CASE_NBR, TLA_PROP. STR_NBR, TLA_PROP. STR_NBR_RNG_END, TLA_PROP. STR_FRAC_NBR,
    TLA_PROP. STR_FRAC_NBR_RNG_END, TLA_PROP. STR_DIR_CD, TLA_PROP. STR_NM, TLA_PROP. STR_SFX_CD, TLA_PROP. STR_SFX_DIR_CD,
    TLA_PROP. STR_UNIT_TYP_CD, TLA_PROP. UNIT_NBR, TLA_PROP. UNIT_NBR_RNG_END, TLA_PROP. ZIP_CD, TLA_PROP. ZIP_CD_SFX, TLA_PROP. CNCL_DIST_NBR,
    TLA_PROP. PLAN_AREA_NBR, TLA_PROP. ZONE_REG_CD, TAPLC. PROJ_DESC_TXT, TCASE. CASE_ID, TCASE. CASE_NBR, taplc.aplc_id
    FROM TLA_PROP INNER JOIN ((TAPLC INNER JOIN TCASE ON TAPLC. APLC_ID = TCASE. TLOC INNER JOIN APLC_ID) ON TAPLC. APLC_ID = TLOC. APLC_ID) ON TLA_PROP. PROP_ID = TLOC. LOC_ID
    WHERE TCASE. CASE_NBR '% HPOZ %' and TCASE. CASE_NBR = ' #form.caseNbr # '.


    ' #form.caseNbr # ' is the input on my Inbox field.

    I am a beginner and I'm not used to the joints and joints in the class

    Second query
    Toad, I use this query
    Select
    Tcase.case_id
    Tcase.case_NBR
    tcntct. CNTCT_ID as ownerInformation
    tcntct.CO_BUSN_NM, tcntct. FRST_NM, tcntct. LST_NM
    tcntct_owner.cntct_id as repInformation
    tcntct_owner.CO_BUSN_NM
    tcntct_owner. FRST_NM
    tcntct_owner. LST_NM
    Tref_plan_area.plan_area_desc
    tcase_req.case_req_id
    tcase_req.case_req_typ_cd
    tcase_req.sys_user_id
    tla_prop.pin
    tla_prop.cncl_dist_nbr
    tla_prop. PLAN_AREA_NBR
    tla_prop.str_nbr
    tla_prop. STR_FRAC_NBR
    tla_prop. STR_DIR_CD
    tla_prop.str_nm
    tla_prop. STR_SFX_CD
    tla_prop. STR_SFX_DIR_CD
    tla_prop. STR_UNIT_TYP_CD
    tla_prop. UNIT_NBR
    tla_prop. ZIP_CD
    tla_prop. ASSR_PRCL_NBR
    TLA_PROP. ZONE_REG_CD
    Of
    TLOC, tla_prop, tcase, tref_plan_area, tcase_req, tcntct_aplc, tcntct, tcntct_aplc tcntct_aplc_owner, tcntct tcntct_owner / * tcntct_tla_prop, tcntct * /.

    where
    tla_prop.prop_id = tloc.loc_id
    and
    tla_prop.plan_area_nbr = tref_plan_area .plan_area_NBR
    and
    TLOC.aplc_id = tcase.aplc_id
    and
    Tcase.case_id = tcase_req .case_id
    and
    tcase_req. CASE_req_typ_CD like '% HPOZ % '.
    /*

    and

    tla_prop.prop_id = tcntct_tla_prop. PROP_ID (+)

    and

    tcntct_tla_prop. CNTCT_ID = tcntct. CNTCT_ID (+)

    */

    and

    Tcase.aplc_id = tcntct_aplc. APLC_ID (+)
    and

    tcntct_aplc.cntct_id = tcntct.cntct_id (+)
    and

    (tcntct_aplc. CNTCT_TYP_CD = 'A' or tcntct_aplc .cntct_typ_cd is null)
    and

    Tcase.aplc_id = tcntct_aplc_owner .aplc_id (+)
    and

    tcntct_aplc_owner.cntct_id = tcntct_owner.cntct_id (+)
    and

    (tcntct_aplc_owner.cntct_typ_cd = 'R' or tcntct_aplc_owner.cntct_typ_cd is null)
    /*

    Group

    Tcase.case_id,

    Tcase.case_NBR,

    Tref_plan_area.plan_area_desc

    tcase_req.case_req_id

    tcase_req.case_req_typ_cd

    tcase_req.sys_user_id

    tla_prop.pin

    tla_prop.cncl_dist_nbr

    tla_prop. PLAN_AREA_NBR

    tla_prop.str_nbr

    tla_prop. STR_FRAC_NBR

    tla_prop. STR_DIR_CD

    tla_prop.str_nm

    tla_prop. STR_SFX_CD

    tla_prop. STR_SFX_DIR_CD

    tla_prop. STR_UNIT_TYP_CD

    tla_prop. UNIT_NBR

    tla_prop. ZIP_CD

    tla_prop. ASSR_PRCL_NBR,

    tcntct.CO_BUSN_NM
    tcntct. FRST_NM
    tcntct. LST_NM,

    tcntct_owner.CO_BUSN_NM
    tcntct_owner. FRST_NM
    tcntct_owner. LST_NM

    */

    order by

    to get
    Tref_plan_area.plan_area_desc or simply get plan_area_desc. This is done by a join tla_prop.plan_area_nbr = tref_plan_area .plan_area_NBR.

    I always use the first query (the first query above), but he has joined in the from clause.
    My question is that I am still trying to get plan_area_desc and want to integrate a syntax of the second query in the first query.

    What I did it was an error was (error)

    Added to the table of and put this = tref_plan_area .plan_area_NBR tla_prop.plan_area_nbr.
    In where clause. It did not work. Can someone help me on how I can always get the .plan_area_NBR of tref_plan_area.

    What I add to the first query
    Thank you

    .. .or maybe this?

    SELECT TLA_PROP. PIN,
    TLA_PROP. ASSR_PRCL_NBR,
    TCASE. CASE_NBR,
    TLA_PROP. STR_NBR,
    TLA_PROP. STR_NBR_RNG_END,
    TLA_PROP. STR_FRAC_NBR,
    Tref_plan_area.plan_area_desc
    TLA_PROP. STR_FRAC_NBR_RNG_END,
    TLA_PROP. STR_DIR_CD,
    TLA_PROP. STR_NM,
    TLA_PROP. STR_SFX_CD,
    TLA_PROP. STR_SFX_DIR_CD,
    TLA_PROP. STR_UNIT_TYP_CD,
    TLA_PROP. UNIT_NBR,
    TLA_PROP. UNIT_NBR_RNG_END,
    TLA_PROP. ZIP_CD,
    TLA_PROP. ZIP_CD_SFX,
    TLA_PROP. CNCL_DIST_NBR,
    TLA_PROP. PLAN_AREA_NBR,
    TLA_PROP. ZONE_REG_CD,
    TAPLC. PROJ_DESC_TXT,
    TCASE. CASE_ID,
    TCASE. CASE_NBR,
    taplc.aplc_id
    OF TLA_PROP
    INNER JOIN tref_plan_area ON tla_prop.plan_area_nbr = tref_plan_area.plan_area_NBR
    INNER JOIN TLOC ON TLA_PROP. PROP_ID = TLOC. LOC_ID
    INNER JOIN TAPLC ON TLOC. APLC_ID = TAPLC. APLC_ID
    INNER JOIN TCASE ON TAPLC. APLC_ID = TCASE. APLC_ID
    WHERE TCASE. CASE_NBR Like '% HPOZ % '.
    AND TCASE. CASE_NBR = 'DIR-2004-4269-HPOZ-CCMP.

    Phil

  • Calculate the space used in the database!

    Hi all

    I can calculate the space used by using one of the following ways:

    1. determine the size allocated by issuing

    SELECT SUM(d.bytes/1024/1024/1024)
    FROM dba_data_files;

    2 calculate the free space by issuing

    SELECT SUM(bytes/1024/1024/1024)
    from dba_free_space;

    Space used will be the value of the first statement - value of the second statement. This is manually!

    Is it possible to combine these two queries?

    Thank you!

    Dan.

    You can certainly combine queries

    SELECT (allocated.bytes - free.bytes )/1024/1024/1024 used_gb
      FROM (select sum(bytes) bytes from dba_data_files) allocated,
          (select sum(bytes) bytes from dba_free_space) free
    

    Normally, you could group tablespace as well.

    But if you want just the amount of space used, it is probably easier to just

    SELECT sum(bytes)/1024/1024/1024 used_gb
      FROM dba_segments
    

    Justin

  • Psychrometric charts using in Labview to calculate moisture?

    I built a hygrometer to mirror cooled for a school project and all control through labview. I'll have the dew point and the temperature of the dry dry bulb that I need to calculate the rate of moisture through an algorithm or a look up table psychrometric charts. can anyone help please.

    The necessary equations to calculate the relative humidity of pressure and dry and wet bulb temperature can be found here:
    http://www.SRH.NOAA.gov/ELP/wxcalc/formulas/rhTdFromWetBulb.html
    With both temperatures and pressure to come as long as variables, I would break just calculating what they have on the Web page linked, by first calculating the pressure of saturated steam and wet bulb ==> and then calculate the actual vapour pressure ==> then the relative humidity. All operators you need for these calculations must be under the function of mathematical operators range. You could call all individual operations, including the exponentials, or just use a few knots of formula.
    Of course, just dump everything in a while loop (with a delay), to make the system constantly monitor and update the moisture.

  • Merge the queries based on the conditional

    Apex 4.2

    I have a pretty complex question. I have a page that will have a selection list on the data entry form. The selection list contains a list of both 1) Active only or 2) active and inactive areas. We show the active areas when we create a new record (P101_ID IS NULL), we appear active and inactive sectors when you edit a record (P101_ID IS NOT NULL). I have therefore two separate queries to account for each case. Simple so far.

    Problem I am seeing that create two lists of selection on the page and put a separate condition on each one (hiding one of selection lists depending on the case the ID IS NULL or the ID IS NOT NULL) does not work. So I was wondering if there was a way to combine queries for that to work based on a conditional statement. I did experiment with the instructions box and unions, etc., but my questions are a bit complicated. They are as follows:

    LIST OF ASSETS SECTORS (P101_ID is NULL)

    Select unique
    ISEC.inspection_sector_name,
    ISEC.inspection_sector_id
    From
    INSPECTION_SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where (ISEC.hurricane_protection_flag = :P157_IS_HURR and ISEC.river_protection_flag = :P157_IS_RIV) AND
    ISEC.superseded_date is null AND
    ISEC.commenced_date is not null AND
    ISEC.inspection_sector_id not in (
    Select ISEC.inspection_sectors_id
    From INSPECTION_SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where SCH.high_water_event_id = :P157_high_water_event_id AND
    SCH.inspection_date = :P157_inspection_date)
    OR ISEC.inspection_sector_id = :P157_inspection_sector_id AND
    ISEC.superseded_date is null
    Order by inspection_sector_name
    

    LIST ACTIVE AND INACTIVE SECTORS (P101_IS is NOT NULL)

    Select inspection_sector_name, inspection_sector_id From (
    Select ISEC.inspection_sector_name, ISEC.inspection_sector_id, '0' as this
    From dual, INSPECTION_SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where (ISEC.hurricane_protection_flag = :p157_IS_HURR and ISEC.river_protection_flag = :P157_IS_RIV) AND
    ISEC.superseded_date is null AND
    ISEC.commenced_date is not null AND
    ISEC.inspection_sector_id not in (
    Select ISEC.inspection_sector_id
    From inspection_sectors ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where SCH.high_water_event_id = :P157_high_water_event_id AND
    SCH.inspection_date = :P157_inspection_date)
    OR ISEC.inspection_sector_id = :P157_inspection_sector_id AND ISEC.superseded_date is null
    UNION
    Select unique
    ISEC.inspection_sector_name|| ' [CLOSED]', ISEC.inspection_sector_id, '1' as this
    From dual, INSPECTION_SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where ISEC.superseded_date is not null and ISEC.commenced_date is not null AND
    ISEC.river_protection_flag =:P157_IS_RIV and ISEC.hurricane_protection_flag = :P157_IS_HURR AND
    ISEC.inspection_sector_id not in (
    Select ISEC.inspection_sector_id
    From INSPECTION SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where SCH.high_water_event_id = :P157_high_water_event_id AND
    SCH.inspection_date = :P157_inspection_date)
    OR ISEC.inspection_sector_id = :P157_inspection_sector_id NAD ISEC.superseded_date is not null
    Order by this, inspection_sector_name asc
    

    If the requests are quite complex. I tested the times and they work in APex, separately from the course. Forgive me if I have mispeled anything. But any help on this would be greatly appreciated. Thanks in advance.

    Thank you for taking to your friend Frank. You are a bird-guy (my attempt at sarcasm). Nobody has questioned whether its knowledge base; more so in the way he responded to my original post did not «do» Like the people who come on this forum looking for help to those who have greater knowledge, it would be nice to be greeted a little more friendly, lol. Just my thoughts. But, feel free to correct my spelling test, grammar and syntax in my sentences so (the effort once again to emphasize that I misspelled 'AND', and that the request would not be performed--> of course... smh... you are funny)

    Apparently I failed to explain the issue in its entirety. I should start by saying... "I have two separate petitions that I tested and already working and am looking to put on a list of selection (at the top) with a conditional execution statement one or the other, through the conditional statement, but again, I was looking for more so for syntax and structure." I'm sorry, I forgot to mention that.

    Anyway, enough of this. I found a solution to my problem:

    Within the Apex 4.2, you can have a list of selection as a page element. I want to display different results depending on whether Yes or no P101_ID is set to Null or NOT NULL

    P101_ID is a primary key for a table.

    P101_ID is not the exact name I use in my application / request however.

    In addition, you don't need to include double; It's not make or break the query. Something that I forgot to omit them.

    In addition, something along the lines of

    Select inspection_sector_name, inspection_sector_id From (
    .....all the stuff in query 1.......)
    Where P101_ID is null
    UNION
    Select inspection_sector_name, inspection_sector_id From (
    ....all the stuff in query 2.....)
    Where P101_ID is not null
    

    will work on a selection list in the APex. So problem solved. Thank you for all your wonderful insight, of words and thoughts. Thank you.

  • Can we do Union between 2 fields in OBIEE formula column?

    Hello gurus,

    Can we do the union between 2 fields and calculate a column that in the criteria of the obiee report?

    Vieira says:
    Hey David,

    I m using the same method to evaulte year and MOnthname

    Year: YEAR (CURRENT_DATE)

    Name of the month: MONTHNAME (TIMESTAMPADD (SQL_TSI_MONTH-1, CURRENT_DATE))

    but I want both values in unique colmun...
    Because I have to create a report that runs to the year and last month both at the same time.
    so once I have it calculate such doin union between YEAR and MONTHNAME column, I'll use the PivotTable to create this report...
    So basically I want a column that has the CURRENT YEAR, LAST MONTHNAME as list of values. and that's the reason why I want the union in the formula in the column...

    Let me know if you need more information...

    OK, got it.

    So follow these steps:

    (1) in your first report, put your attribute columns and measure your column a dummy column.

    (2) place a filter on the column "equal to / in".

    MONTH = MONTH (table.date) (TIMESTAMPADD (SQL_TSI_MONTH-1, CURRENT_DATE))

    (3) in the fx of the dummy column, delete content and enter 'Previous month' and name the 'Date Range' column (or whatever you want).

    This will generate a report where the measure is for the previous month.

    (4) in your second report, put the same attribute columns and measure your column a dummy column.

    (5) place a filter on the column "equal to / in".

    Year (table.date) = YEAR (CURRENT_DATE)

    (6) in the fx of the dummy column, delete the content and enter "current Year-to-Date" and name the 'Date Range' column (or what you want).

    This will generate a report where the measure is for the current year.

    (7) combine queries into a UNION.

    The synthesis report will have the values "previous month" and "current year-to-date" in the same column you want.

    (8) in your PivotTable, put the attribute columns in the Section of lines, as in measures Section and the 'Date Range' column in the columns Section.

    That should do it.

  • Ridge detector malfunctioned.

    Hello

    I'm working on a project in which I want to calculate the rate of certain signals. I used the Ridge detector to detect the peak of the wave.

    The Ridge detector works properly, but after some time as 40 seconds it starts counting the noise (which is less than the value of the Amplitude, and which was previously not count), I don't know the reason for it.

    Can someone pls help me solve this problem

    Thank you v.much

    Hello

    Finally working on the first vi I found the solution to my problem

    The reason why I got for the evolution of the value of the rate was this picture filled, i.e. with time, the table gets more and more values and he took the time to work on it and therefore the vi give erroneous results in the rate.

    I finally limited the value of the table and then past this range limited to the consumers section of producer for the calculation and then it worked correctly.

    I ask everyone to answer me if I took the right path for the solution.

    Thanks to all who have helped me get a solution.

    Concerning

  • Error in harmonic distortion VI Analyzer?

    Hello

    Today, I tried to use the harmonic distortion VI Analyzer and it seems that there is a mistake in the VI (or I misunderstood something...).

    The phenomenon I've observed may very well shown in the attached example.

    Description:

    -THD - calc: output for the THD calculated by hand with the amplitudes (in this example: THD = sqrt(2^2+3^2)/4 = 0.901)

    -THD - VI: output calculated by the VI of harmonic distortion Analyzer

    The two results are the same if the number of analyzed periods is > = 3 (periods # = number of samples * fundamental frequency / Fs). If only 1 or 2 periods are analysed, the harmonic distortion Analyzer VI gives an incorrect result.

    What is the error? I did a wrong settings or is this a problem with VI?

    Thanks in advance for the help.

    Best regards

    Stefan

    If you open the block diagram of VI harmonic distortion Analyzer, you'll see he's using Fourier transform techniques to calculate the rate of HARMONICS.  TFF does not work well with a small number of cycles and can have significant errors when fractional cycles are involved.

    In VI you posted increasing the number of samples to 300 product results identical to 5 significant digits. To 200 samples the error is about 10%.

    When working with the FFT based analysis tools, use a lot of cycles.

    Lynn

  • Example code to read an ER3000 continuousy pressure

    I working on a program to control an ER3000 and am tring to use a waveform chart to keep up the pressure. Also, I want to be able to use the current pressure to calculate the rate of Exchange to a new setting of pressure because the ships that we are in charge cannot take quick pressure changes. Does anyone have the sample code specifically for the reading of the pressure on tescoms ER3000.

    Tim,

    Taking a brief look at the llb linked above it seems as if the "fully ER Command.vi, this is what you want. This vi is read/write vi. But it runs only once. Therefore, there is not a surprise that you have a program that reads and writes to the ER3000. To "read the continuous pressure" you want to make your own vi that has the part 'read' of the 'fully ER Command.vi loop within a certain time. If find you examples in labview for VISA it should help you get started.

    Don't forget that if you want to always read the Session VISA will be 'locked '. Which means that you can't write while he performs a continuous reading of the session VISA. You can either programmatically explain this or (if RS232) you can install a sniffer that can interrogate another COM port WITHOUT interfering with your current session of VISA to the device permanently.

    Hope that it becomes at least to get started in the right direction.

    Best regards

    -chazzzmd

Maybe you are looking for

  • If I reformat my iMac he will wipe away my iDevices when connecting to a new iTunes?

    Hello I want to reformat my iMac to a new configuration, because it didn't happen in 6 years. I wonder, once I reformatted the iMac how do reconnect you all iDevices without wiping those who, as I believe that if he has not connected before it gives

  • This module requires a Lynxmotion AL5A robotic using LabVIEW arm control

    Hello world I'm a little confused about what NI LabVIEW toolkits to be used in order for me to program the arm Lynxmotion robotic. Somebody has arms lynxmotion robot programming experience using labview? What should be awared by selecting the correct

  • Reference Dell V715w stops printing after 1 post

    Hi I have a Dell v715w which stops printing after printing 1 job.  I mean it prints 1 whole work and then 5 minutes later if you are going to print anything else nothing happens. I have to remove all the dle *. * process, stop the spooler service, an

  • Lost my startup icon

    I lost my start icon in my taskbar. It can not open my programs. How can I return the icon start? Thank you

  • Change boot order

    Hello everyone. My first time on this forum.  If all goes well, I'm compatible with its label.  Please correct if I'm not. I'm trying to boot from an external hard drive (Seagate).  This drive has a LInux distro.  I use a HP-ProBook-4525 s with Windo