My nested CASE WHEN THEN ELSE is not working.

I'm working on a report that will provide a status on a component based on a defined Matrix.  The status to report is determined in a hierarchal fashion...the highest seqence number status existing is reported. 
I've capped the sequence number at 10 (@SeqNumCap_sav)
The matrix table is defined as such:
CREATE TABLE [dbo].[tblAssyLineComponentStatusMatrix](
[MatrixAssyLine] [char](1) NOT NULL,
[MatrixComponentProduct] [char](15) NOT NULL,
[MatrixComponentStatusSequence] [decimal](3, 0) NOT NULL,
[MatrixComponentStatus] [char](3) NOT NULL,
[MatrixStatusDescription] [nvarchar](100) NOT NULL,
[MatrixReportedDescription1] [nvarchar](50) NOT NULL,
[MatrixReportedDescription2] [nvarchar](50) NULL,
[MatrixReportedDescription3] [nvarchar](50) NULL,
[MatrixReportedDescription4] [nvarchar](50) NULL,
[MatrixReportedDescription5] [nvarchar](50) NULL
) ON [PRIMARY]
This is a sample of the tblAssyLineComponentStatusMatrix data:
MatrixAssyLine MatrixComponentProduct MatrixComponentStatusSequence MatrixComponentStatus MatrixStatusDescription MatrixReportedDescription1 MatrixReportedDescription2 MatrixReportedDescription3 MatrixReportedDescription4 MatrixReportedDescription5
E Mast/PullRod    1 W   The part has been stamped or welded. Class3PullRods NULL NULL NULL NULL
E Mast/PullRod    2 P   The part has been clicked off in a paint hang station. TSMastPaintHang NULL NULL NULL NULL
E Mast/PullRod    3 Y   The part has been clicked off in paint pulldown. TSMastPaintUnload NULL NULL NULL NULL
the tblProductionControlComponentReporting is defined as:
CREATE TABLE [dbo].[tblProductionControlComponentReporting](
[WorkUnit] [nvarchar](15) NOT NULL,
[Description] [nvarchar](50) NOT NULL,
[Completed] [datetime] NOT NULL,
[UserID] [nvarchar](30) NULL,
[StationID] [nvarchar](30) NULL,
[Undo] [bit] NULL,
[CompletedUndo] [datetime] NULL,
[UserIDUndo] [nvarchar](30) NULL,
[StationIDUndo] [nvarchar](30) NULL,
[ComponentPartNo] [varchar](15) NULL,
[ComponentClass] [varchar](3) NULL,
[ComponentQty] [decimal](6, 2) NULL,
[ComponentScheduleDate] [datetime] NULL,
[ComponentScheduleShift] [decimal](1, 0) NULL,
[ComponentScheduleWorkunitSequence] [int] NULL,
[ComponentComment] [varchar](200) NULL
) ON [PRIMARY]
A sample of the tblProductionControlComponentreporting data:
assyline WorkUnit Description Completed UserID StationID
E 639422 Class3PullRods 2014-09-15 13:15:44.607 GLOBAL\agmesusr ag2100156
E 639422 Class3PullRods 2014-09-15 13:15:44.607 GLOBAL\agmesusr ag2100156
E 639422          TSFrameFabDeliver 2014-09-25 11:31:44.380 NULL MCA
E 639422 TSMastPaintHang 2014-09-25 22:56:43.740 009932 AG2100294
The problem is that the below code is returning multple records which is causing an error ... if I resequence the above Matrix table data where #3 becomes #10, 2 becomes #9 and 1 becomes #8, the query works fine - but this approach doesn't allow for easy
expansion of the data.  Can anyone help me see the problem here?
use eschedule
declare @Workunit varchar(max)
declare @SeqNumCap_sav dec(3, 0)
set @WorkUnit='639422'
set @SeqNumCap_sav= (select top 1 SequenceValueCap from tblAssyLineComponentStatusMatrix_SequenceCap order by SequenceValueCap)
select
Mast_PullRodStatus = case
--Seq 10 Mast/PullRod Component Status
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix where MatrixComponentProduct='Mast/PullRod' and MatrixComponentStatusSequence=@SeqNumCap_sav and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then
(select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=@SeqNumCap_sav
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
--Seq 9 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-1)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-1)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
--Seq 8 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-2)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-2)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
--Seq 7 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-3)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-3)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
--Seq 6 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-4)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-4)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
--Seq 5 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-5)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-5)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
--Seq 4 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-6)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-6)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
--Seq 3 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-7)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-7)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
--Seq 2 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-8)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod' and MatrixComponentStatusSequence=(@SeqNumCap_sav-8))
--Seq 1 Mast/PullRod Component Status
else case
when (select top 1 [description] from tblproductioncontrolcomponentreporting
where ([description] = (select MatrixReportedDescription1 from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-9)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))))
and Workunit=@WorkUnit
--and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit))
) is not null
then (select MatrixComponentStatus from tblAssyLineComponentStatusMatrix
where MatrixComponentProduct='Mast/PullRod'
and MatrixComponentStatusSequence=(@SeqNumCap_sav-9)
and (MatrixAssyLine=(select assyline from tblProductionControlHeader h where h.workunit=@WorkUnit)))
else ' '
end
end
end
end
end
end
end
end
end
end
Assume Assyline='E'
Eva Leggett

Good job posting the DDL.
Your example data should be in a table format though.
DECLARE @tblAssyLineComponentStatusMatrix TABLE (MatrixAssyLine char(1) NOT NULL, MatrixComponentProduct char(15) NOT NULL, MatrixComponentStatusSequence decimal(3, 0) NOT NULL, MatrixComponentStatus char(3) NOT NULL, MatrixStatusDescription nvarchar(100) NOT NULL, MatrixReportedDescription1 nvarchar(50) NOT NULL, MatrixReportedDescription2 nvarchar(50) NULL, MatrixReportedDescription3 nvarchar(50) NULL, MatrixReportedDescription4 nvarchar(50) NULL, MatrixReportedDescription5 nvarchar(50) NULL)
INSERT INTO @tblAssyLineComponentStatusMatrix (MatrixAssyLine, MatrixComponentProduct, MatrixComponentStatusSequence, MatrixComponentStatus, MatrixStatusDescription, MatrixReportedDescription1, MatrixReportedDescription2, MatrixReportedDescription3, MatrixReportedDescription4, MatrixReportedDescription5) VALUES ('E' ,'Mast/PullRod' ,1 ,'W' ,'The part has been stamped or welded. ','Class3PullRods ' ,NULL, NULL, NULL, NULL)
INSERT INTO @tblAssyLineComponentStatusMatrix (MatrixAssyLine, MatrixComponentProduct, MatrixComponentStatusSequence, MatrixComponentStatus, MatrixStatusDescription, MatrixReportedDescription1, MatrixReportedDescription2, MatrixReportedDescription3, MatrixReportedDescription4, MatrixReportedDescription5) VALUES ('E' ,'Mast/PullRod' ,2 ,'P' ,'The part has been clicked off in a paint hang station. ','TSMastPaintHang ' ,NULL, NULL, NULL, NULL)
INSERT INTO @tblAssyLineComponentStatusMatrix (MatrixAssyLine, MatrixComponentProduct, MatrixComponentStatusSequence, MatrixComponentStatus, MatrixStatusDescription, MatrixReportedDescription1, MatrixReportedDescription2, MatrixReportedDescription3, MatrixReportedDescription4, MatrixReportedDescription5) VALUES ('E' ,'Mast/PullRod' ,3 ,'Y' ,'The part has been clicked off in paint pulldown. ','TSMastPaintUnload ' ,NULL, NULL, NULL, NULL)
DECLARE @tblProductionControlComponentReporting TABLE (WorkUnit nvarchar(15) NOT NULL, Description nvarchar(50) NOT NULL, Completed datetime NOT NULL, UserID nvarchar(30) NULL, StationID nvarchar(30) NULL, Undo bit NULL, CompletedUndo datetime NULL, UserIDUndo nvarchar(30) NULL, StationIDUndo nvarchar(30) NULL, ComponentPartNo varchar(15) NULL, ComponentClass varchar(3) NULL, ComponentQty decimal(6, 2) NULL, ComponentScheduleDate datetime NULL, ComponentScheduleShift decimal(1, 0) NULL, ComponentScheduleWorkunitSequence int NULL, ComponentComment varchar(200) NULL)
INSERT INTO @tblProductionCOntrolComponentReporting (WorkUnit, Description, Completed, UserID, StationID) VALUES (639422, 'Class3PullRods', '2014-09-15 13:15:44.607', 'GLOBAL\agmesusr', 'ag2100156')
INSERT INTO @tblProductionCOntrolComponentReporting (WorkUnit, Description, Completed, UserID, StationID) VALUES (639422, 'Class3PullRods', '2014-09-15 13:15:44.607', 'GLOBAL\agmesusr', 'ag2100156')
INSERT INTO @tblProductionCOntrolComponentReporting (WorkUnit, Description, Completed, UserID, StationID) VALUES (639422, 'TSFrameFabDeliver', '2014-09-25 11:31:44.380', NULL, 'MCA')
INSERT INTO @tblProductionCOntrolComponentReporting (WorkUnit, Description, Completed, UserID, StationID) VALUES (639422, 'TSMastPaintHang', '2014-09-25 22:56:43.740', '009932', 'AG2100294')
Your code is a mess, it would take longer to untangle it that it would to solve your problem.
Can you give us an expected output, and perhaps the rules governing what your case statement should be doing?

Similar Messages

  • If then Else statement not working under Computation in APEX

    Hi
    Can anyone help me where I am going wrong? I am trying to use the following code in Computation Process on Submit. I am not able to get the value. It's showing nothing.
    Page:
    *Item Name (Value Required)
    Type
    Static Assignment
    PL/SQL Function Body
    SQL Query (return single value)
    SQL Query (return colon separated value)
    SQL Expression
    PLSQL Expression
    Item Value
    Computation Point
    *Sequence (Value Required)
    Computation Point
    On New Instance (new session)
    Before Header
    After Header
    Before Region(s)
    After Region(s)
    Before Footer
    After Footer
    After Submit
    Source
    *Computation (Value Required)
    BEGIN
    IF :P3_AGING_DAYS <= '0' THEN
    :P3_AGING_BUCKET := 'Within due date';
    elsif :P3_AGING_DAYS > '0' AND :P3_AGING_DAYS <= '3' then
    :P3_AGING_BUCKET := 'Within 3 days';
    end if;
    end;

    1efb2968-171d-43f9-9d5d-d38151735ed7 wrote:
    Please update your forum profile with a real handle instead of "1efb2968-171d-43f9-9d5d-d38151735ed7".
    Can anyone help me where I am going wrong? I am trying to use the following code in Computation Process on Submit. I am not able to get the value. It's showing nothing.
    BEGIN
    IF :P3_AGING_DAYS <= '0' THEN
    :P3_AGING_BUCKET := 'Within due date';
    elsif :P3_AGING_DAYS > '0' AND :P3_AGING_DAYS <= '3' then
    :P3_AGING_BUCKET := 'Within 3 days';
    end if;
    end;
    A PL/SQL Function Body computation has to return a value rather than assigning it to an item in the PL/SQL block (APEX turns the block into the body of a function). The item for which the value is to be computed is specified in the computation properties (P3_AGING_BUCKET).
    begin
      return case
               when :p3_aging_days < 1
               then
                 'Within due date'
               when :p3_aging_days between 1 and 3
               then
                 'Within 3 days'
             end;
    end;

  • Case when then not working

    In my database, two variable ID and time (varchar2) are there. I want to populate another variable using case when then by putting below conditon to convert like this
    But its not working. Can anyone help me
    if time =1 day then '1 Day'
    time > 2 days and time <=7 days then '2 to 7 days'
    time > 8 days and time <=15 days then '8 to 15 days'
    else 'not matching'
    ID Time
    12 1 days
    23 244 days
    12 2 days
    14 4 days
    15 6 days
    17 9 days
    select time,
    case WHEN
    UPPER(Time) = '1 DAY'
    THEN
    '1 day'
    WHEN
    UPPER(Time) Between '2 DAYS' and '7 DAYS'
    THEN
    '2 to 7 days'
    WHEN
    UPPER(Time) Between '8 DAYS' and '15 DAYS'
    THEN
    '8 to 15 days'
    ELSE
    'Not matching'
    END "update time"
    from table1

    900487 wrote:
    In my database, two variable ID and time (varchar2) are there. If you are storing Days in a column store it as NUMBER or INTERVAL data type. The way you have stored the value looks incorrect.
    What you can do is extract the number portion of your time column and apply the CASE statement. Something like this
    SQL> with t
      2  as
      3  (
      4  select 12 id, '1 days' time1 from dual union all
      5  select 23 id, '244 days' time1 from dual union all
      6  select 12 id, '2 days' time1 from dual union all
      7  select 14 id, '4 days' time1 from dual union all
      8  select 15 id, '6 days' time1 from dual union all
      9  select 17 id, '9 days' time1 from dual
    10  )
    11   select id,
    12          time1,
    13          case when time1 = 1              then '1 day'
    14               when time1 between 2 and 7  then '2 to 7 days'
    15               when time1 between 8 and 15 then '8 to 15 days'
    16               else 'not matching'
    17          end "update time"
    18     from (
    19              select id, to_number(regexp_substr(time1, '^[[:digit:]]*')) time1
    20                from t
    21          )
    22  /
            ID      TIME1 update time
            12          1 1 day
            23        244 not matching
            12          2 2 to 7 days
            14          4 2 to 7 days
            15          6 2 to 7 days
            17          9 8 to 15 days
    6 rows selected.

  • CASE WHEN THEN END

    Hello everyone,
    We have a function return Y or N.
    We have 2 table YTable YT and NTable NT.
    We are using UNION now.
    SELECT ONE.CL1
    FROM (
    SELECT CL1Y FROM YTable WHERE FUNCTION = 'Y'
    UNION
    SELECT CL1N FROM NTable WHERE FUNCTION = 'N') ONEWe are wondering to use CASE, WHEN, THEN, END.
    Is it possible or NOT?
    If you have a chance, please share your experiences.
    Thanks in advance,
    NY
    P.S.
    If you have more questions, please let us know.
    Edited by: New Yorker on Aug 31, 2010 10:08 AM

    New Yorker,
    According to the given SQL block, the case function can not be used. You can use the case function with multiple table joins but you can only use the CASE WHEN ELSE END block for one column.
    If i got your question correct, that is my answer to your question.
    Regards.
    Ogan

  • How to create nested case when statement in OBIEE 11g?

    Hi All,
    I need to create a formula using nested case when statement. The formula to be created is below:
    =If([AWRV]<0; "<0";
    If([AWRV]=0; "0";
    If([AWRV]<=15; ">0 and <=15";
    If([AWRV]<=25; ">15 and <=25";
    If([AWRV]<=50; ">25 and <=50";
    If([AWRV]<=75; ">50 and <=75";
    If([AWRV]<=100; ">75 and <=100";
    If([AWRV]<=200; ">100 and <=200";
    If([AWRV]<=500; ">200 and <=500";
    If([AWRV]<=1000; ">500 and <=1000";
    If([AWRV]<=5000; ">1000 and <=5000";
    If([AWRV]<=10000; ">5000 and <=10000"; ">10000"))))))))))))
    How to recreate using Nested case when? I tried in many different ways but it is displaying syntax error in obiee11g. This is very critical. Can anybody shed light on this issue pls?
    Thanks in advance,
    Thenmozhi

    Honey26 wrote:
    Hi All,
    I need to create a formula using nested case when statement. The formula to be created is below:
    =If([AWRV]<0; "<0";
    If([AWRV]=0; "0";
    If([AWRV]<=15; ">0 and <=15";
    If([AWRV]<=25; ">15 and <=25";
    If([AWRV]<=50; ">25 and <=50";
    If([AWRV]<=75; ">50 and <=75";
    If([AWRV]<=100; ">75 and <=100";
    If([AWRV]<=200; ">100 and <=200";
    If([AWRV]<=500; ">200 and <=500";
    If([AWRV]<=1000; ">500 and <=1000";
    If([AWRV]<=5000; ">1000 and <=5000";
    If([AWRV]<=10000; ">5000 and <=10000"; ">10000"))))))))))))
    How to recreate using Nested case when? I tried in many different ways but it is displaying syntax error in obiee11g. This is very critical. Can anybody shed light on this issue pls?
    Thanks in advance,
    ThenmozhiTry the below:
    CASE WHEN "Fact - Open Chargeback"."Sub Chbk Amt" < 0 THEN ' <0'
    WHEN "Fact - Open Chargeback"."Sub Chbk Amt" = 0 THEN '0'
    WHEN "Fact - Open Chargeback"."Sub Chbk Amt" BETWEEN 0 AND 15 THEN '>0 AND <=15'
    END
    Hope this helps.

  • Case-when-then logic in join condition

    Is it possible to implement case when then logic in join condition?
    Instead of:
    INGRP1.COL1 = INGRP2.COL1 (+)
    something like:
    case
    when INGRP1.COL2 IS NULL
    then INGRP1.COL1 = INGRP2.COL1 (+)
    else INGRP1.COL3 = INGRP2.COL3 (+)
    end
    expression builder for join condition.
    Any help much appreciated.

    Hi Kaiser,
    this is my variant
    1) join first table with second table twice (define two input group in join, include second table in mapping twice and map them to appropriate join group)
    INGRP1.COL1=INGRP2.COL1(+) and INGRP1.COL3=INGRP3.COL3(+)
    2) after join calculate attributes from second table with expression like
    case when COL2 IS NULL the INGRP2_ATTR else INGRP3_ATTR end
    Maybe anyone has a better solution...
    Regards,
    Oleg

  • Obiee nested case when statements

    Hi Obiee Experts, I need to retrieve amounts for 'last september' so i created a column using this case statement: case when MONTH(CURRENT_DATE) <= 9 then (YEAR(CURRENT_DATE) -1) * 100 + 9 END  --  now i want to retrieve the amount for last september using another case statemnt but i get a syntax err message, when i use: CASE WHEN (case when MONTH (CURRENT_DATE) <= 9 then (YEAR(CURRENT_DATE) -1) * 100 + 9 END) THEN "Fact123"."Net Obligation Amount" END ---- Any ideas how to resolve? I will be forever grateful - cheers, Elena

    Honey26 wrote:
    Hi All,
    I need to create a formula using nested case when statement. The formula to be created is below:
    =If([AWRV]<0; "<0";
    If([AWRV]=0; "0";
    If([AWRV]<=15; ">0 and <=15";
    If([AWRV]<=25; ">15 and <=25";
    If([AWRV]<=50; ">25 and <=50";
    If([AWRV]<=75; ">50 and <=75";
    If([AWRV]<=100; ">75 and <=100";
    If([AWRV]<=200; ">100 and <=200";
    If([AWRV]<=500; ">200 and <=500";
    If([AWRV]<=1000; ">500 and <=1000";
    If([AWRV]<=5000; ">1000 and <=5000";
    If([AWRV]<=10000; ">5000 and <=10000"; ">10000"))))))))))))
    How to recreate using Nested case when? I tried in many different ways but it is displaying syntax error in obiee11g. This is very critical. Can anybody shed light on this issue pls?
    Thanks in advance,
    ThenmozhiTry the below:
    CASE WHEN "Fact - Open Chargeback"."Sub Chbk Amt" < 0 THEN ' <0'
    WHEN "Fact - Open Chargeback"."Sub Chbk Amt" = 0 THEN '0'
    WHEN "Fact - Open Chargeback"."Sub Chbk Amt" BETWEEN 0 AND 15 THEN '>0 AND <=15'
    END
    Hope this helps.

  • My Siri and microphone in other apps hasn't been working lately. I've cleaned the mics, took off te case, and it's still not working. My camera only picks up audio when it's off of vibrate. And now I can't answer texts with the new pull down thing.

    My Siri and microphone in other apps hasn't been working lately. I've cleaned the mics, took off te case, and it's still not working. My camera only picks up audio when it's off of vibrate. And now I can't answer texts with the new pull down thing. please help

    Hello Sarahd200037,
    Thanks for using Apple Support Communities.
    To troubleshoot the microphone on your iPhone please follow the steps in the article linked to below.
    iPhone: Microphone issues
    Take care,
    Alex H.

  • "Erase messages in the junk mailbox when:..." not working

    Option to "Erase messages in the junk mailbox when:..." not working.
    I have this set in all accounts to "one day old", but junk mail in the Junk Mailbox older than one day still appears. When I re-select this option under the accounts pref's, junk mail older than one day is properly deleted, but after a day it's back to not deleting anymore!
    I've deleted the Mail pref file, etc, but still no luck.
    Any ideas?

    Well, the Mailbox Behaviors settings are specific for each account, and the On My Mac Junk mailbox isn’t associated with any mail account, so there appears to be no way to specify such setting for that particular mailbox.
    The thing is, the whole situation you’re describing doesn’t really make sense. If those messages end up in the On My Mac Junk mailbox, that means you’re manually marking them as junk after they’ve been moved to a custom “On My Mac” mailbox, which makes me believe what’s really happening here is not that many messages aren’t caught by the junk filter. What appears to be happening is that you have custom rules that prevent the junk filter from being able to catch them...

  • My ipod cclassic 80gb is hang after trying dat press and hold method then also its not working please tell me solution

    My ipod cclassic 80gb is hang after trying dat press and hold method then also its not working please tell me solution

    Thanks for your response and good luck wishes, I suspect I will need them!
    In principle, I agree re: the manufacturer's warranty. However, I am pretty upset that this is now my second iPod to develop a critical fault within weeks of the warranty expiring, and frankly, it is not unreasonable to expect a state-of-the-art $500 electronic device to last well beyond one year of life.
    I agree talking to Apple is not likely to do me any good (the clue is in how impossible they make it to talk to them in the first place) - but that is not necessarily OK. I expect I will have to pay money to get the battery replaced - again, not OK (full stop - but especially given the cost of the device and the money I have spent with Apple). Yes, the batteries have a limited lifespan, but it should last longer than this (and surely, I should notice a gradual decline in its functionality, not an instant stop).
    I will try Deggie's suggestion (see my reply post), but probably won't hold my breath (think I have already done this). I probably will have to get the new battery - and probably under my own steam. It is a principle at stake and I feel I should be able to let Apple know how I'm feeling - and am frustrated that they make this virtually impossible. It sends the very clear message that they are not interested in listening to their customers.

  • Need help when I sign in not working

    ''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/978554 /questions/978554]''
    I did try to follow the update things but could not get that. So how can I get my sign in working?
    XXX
    please help me get my sign in working
    <sub>edit: removed personal information for your protection. (philipp)</sub>

    when I sign in not working. I did try to folow the update but could not get that.
    XXX
    please help me get my sign in working
    <sub>edit: removed personal information for your protection. (philipp)</sub>

  • The sleep/wake function would not show in general to turn it on. I have a Targus case but the function will not work. What's going on?

    The sleep/wake function would not show in general to turn it on. I have a Targus case but the function will not work? The place it should be their is. Auto lock,  Password lock,  and Restrictions

    Keirosform wrote:
    The sleep/wake function would not show in general to turn it on.
    Ther is no "sleep/wake" setting in Settings > General.
    Auto lock,  Password lock,  and Restrictions
    Yes, these are the only three settings..
    I have a Targus case but the function will not work?
    What function? It won't go to sleep?
    Press the Power button on top. Does it sleep?

  • As i was using my itouch(2nd gen)there was a sudden and drastic increase in temperature on the rear portion(metal portion) and since then it is not working.Has anyone come across a similar problem?Any Suggestions?

    As i was using my itouch(2nd gen)there was a sudden and drastic increase in temperature on the rear portion(metal portion) and since then it is not working.Has anyone come across a similar problem?Any Suggestions?

    Sounds to me like the battery has failed.
    You can take it to an Apple Store.  They MAY be able to do something..  Or, you can find parts and "How-To" repair guides on the internet.  eBay and Google are your friends...

  • HT201413 done download update but half way stop then my iphone not working

    connect to pc and start download update as half way error then my iphone not working to start up

    you might want to attempt backing up the device to iTunes and then restoring again.
    http://support.apple.com/kb/HT1766
    maybe even place the device in recovery mode and then restore again as a last resort.
    http://support.apple.com/kb/HT1808

  • Using CASE WHEN THEN in dynamic Region Source area

    Hi all,
    I've been knocking my head around on this one for a while. Hope someone can show me some guidance. So far, the SQL Query in the Region Source works ok except after the THEN ''||'LINK'||'' . All text between the single quotes displays, and not just the hyperlink LINK. (My goal is to this simple test working, then go back an substitute in APP_ID, Page#, SESSION variables.) But I'm stuck with this problem. Searched the forum but this is as far as I got. Below is the code I'm using in the Region Source area. Perhaps a region attribute setting is needed but I'm unsure. Thanks for any assistance. -Mike
    select DISTINCT
        AWARD,
        CASE
        WHEN WINNER_NAME = 'India Retail Support Team'
       THEN '<A HREF="http://www.hotmail.com">'||'LINK'||'</A>'         *----------------HREF link (LINK) is working fine here but doesn't work ok in Region Source.
        ELSE WINNER_NAME
        END WN,
            GBU_WINNER,
            DORDER
    from   GBUSERVICEPACESETTERAWARDS
    where FY = '2012'
    and TYPE = 'Service Award'

    >
    As previously requested, please update your forum profile with a real handle instead of "user10734329".
    I've been knocking my head around on this one for a while. Hope someone can show me some guidance. So far, the SQL Query in the Region Source works ok except after the THEN ''||'LINK'||'' . All text between the single quotes displays, and not just the hyperlink LINK.Not clear from this what the problem is. It appears to me that LINK is all of the "text between the single quotes". What do you mean by "all text"? (An example on apex.oracle.com is a good way to resolve such ambiguities...)
    The usual cause of unexpected results when the separation of concerns is breached and HTML is directly generated in report queries is having the Display Text As report column attribute wrongly set. Ensure it is Standard Report Column rather than the default Display as Text (escape special characters).

Maybe you are looking for

  • Automatic clearing of accounting documents

    We are having an issue with accounting documents for our credit card orders getting cleared automatically as the billing documents are created.  This looks like a standard SAP functionality.  The orders are created with credit card number and it gets

  • Web gallery / Flash Player question

    Not sure where to post this, so I'll start here. In CS3 web gallery, after I create the gallery and it goes to view it, the browser (Safari) open up to a blank page with the following statment / links: Please upgrade your Flash Player.Already have Fl

  • GeForce 6600 & 6800 Ultra or 7800GT in G5 QUAD???

    Hello guys. What better for upgrade? I check tests-and see that 6600 better than Ultra... So... what card I need if I want change my 6600. Any ideas? Thanks for help...

  • Why am I seeing 'codec overrun' when I try to mount the FF8.0 DMG?

    Have just downloaded FF8.0 and tried to open the DMG. But unfortunately I've gotten the warning message that the DMG failed to mount, with the stated reason being 'codec overrun.' Can anyone help?

  • Crashing safari

    on my macbook pro (a few years old) the safari keeps crashing and the computer makes a blue screen and closes everything. What can I do to fix this?