Case statement for aging buckets
OBIEE 11 g. I am trying to create a case statement with aging buckets. Tried in the frontend and the RPD, but on the first bucket made its appearance. (1-30 days old). The other 3 buckets do not appear.
30 - 60 days old
60 - 90 days old
90 - 120 days old
There are dates in the database who meet the criteria for the other 3 buckets. This is the case statement.
use the below the formula instead of what you pasted...
cases where "Date of creation". ' ' Created Date ' > = TIMESTAMPADD (SQL_TSI_DAY-30, CURRENT_DATE) then 1-30 days old '
When "Date Created". " Created Date' <= timestampadd(sql_tsi_day,="" -30,="" current_date="" )="" and="" "created="" date"."created="" date"="">= TIMESTAMPADD (SQL_TSI_DAY,-60, CURRENT_DATE) then 30-60 days old '
When "Date Created". " Created Date' <= timestampadd(sql_tsi_day,="" -60,="" current_date="" )="" and="" "created="" date"."created="" date"="">= TIMESTAMPADD (SQL_TSI_DAY,-90, CURRENT_DATE) then from 60 to 90 days old '
When "Date Created". " "Created Date" <= timestampadd(sql_tsi_day,="" -90,="" current_date="" )="" and="" "created="" date"."created="" date"="">= TIMESTAMPADD (SQL_TSI_DAY,-120, CURRENT_DATE) then 90-120 days old ' end
Thank you
AJ
=>=>=>
Tags: Business Intelligence
Similar Questions
-
Hi all
I am filling a text field based on what the user chooses a drop down which contains the 50 United States of America.
So... Let's say for now I mean 'Birmingham' if the user selects "Alabama", the text field.
The only thing I have at the moment is completely false:
setText() function
{
var statechoice = State.value;
Switch (statechoice) {}
case 1:
Text1.RawValue = "deposit is required in Alabama."
breaking
case 2:
Text1.RawValue = "very cold and the deposit is required in Alaska."
breaking
by default:
Text1.RawValue = "choose a please state";
breaking
}
Must it always be the case 1, 2, 3 and so on? It can never be "case (something is true and something is equal to 7):? I mean, what I always use integers to distinguish the cases?later I want to fill down based on choices that makes the user. I want to have a list of conditional statements where each conditional expresses a unique combination of choice that the user has made.Do you like cold food? YesLactose intolerant? NO.Field of text says "having a cone of ice cream for dessert."How can I get integer values in a drop-down? DropDown.Value? DropDown.index? dropdown.selectedIndex?How to combine these choices in the instructions box? If (dd1 = 1 and 4 = dd2 and dd3 = 2):?Sorry for this discursive question,I just need a good example to follow.Thank you very muchJoeYou can try something like below...
Otherwise, the Switch statement only evaluates to the value that is passed next to the switch control...
var statechoice = State.rawValue;
Switch (statechoice) {}
case "AL":
Text1.RawValue = "deposit is required in Alabama."
Text1.RawValue = Text1.rawValue + setText();
break;
case "AK":
Text1.RawValue = "very cold and the deposit is required in Alaska."
break;
by default:
Text1.RawValue = "choose a please state";
break;
}Added a function inside the same event and call this function in the switch case statements above.
function setText() {}
Switch (otherDropDown.rawValue) {}
case study "Yes":
return "selected Yes;
break;
by default:
Return "No selected ';
break;
}
}I hope this helps...
Thank you
Srini
-
A case statement for modify alphabetically
Hi friends,
I'm using Oracle 11 g.
Please find the creation script of Senario and table with dummy data.
Senario: -.
The table has data like this format below also.
RA1650001
RA1650002
RA1650003
RA1650004
In this case we have to change the data form
RR165M0001
RR165N0002
RR165O0003
RR165P0004
To change the letter M, go to a dcn.table where we maintain data like (SL_NO, Date, Camp_id) (1: 01-06-12, RA165L) and logic will check if the data in the Camp_id column if the data value is "RA165L", which means the 6th position of the data is 'L', so it will change the data from RA1650001 to RR165M0001 aplabetically goes from 'L 'am'. If it is 'Z', then it should go to "A". Don't forget that we have only these four values (RA1650002, RA1650003, RA1650001, RA1650004)
If it is
RA1650002
Then it will change the data to
RR165N0002.
If it is
RA1650003
Then it will change to the data for
RR165O0003.
If it is
RA1650004
Then it will change the data to
RR165P0004.
-----------------------------------------------------------------
table script
CREATE TABLE dcn_control
(
SNO NUMBER NOT NULL,
Date of a DATE_T
CAMPGN_ID VARCHAR2 (7-BYTE) NOT NULL)
------------------
Create table my_table
(
given varchar2 (10) NOT Null
)
Insert into my_table values ('RA1650001')
Insert into my_table values ('RA1650002')
Insert into my_table values ('RA1650003')
Insert into my_table values ('RA1650004')
----------------------------------
insert into dcn_control values(1,sysdate,'RA165L')
---------------------------------
Select * from dcn_control
Select * from my_table
How to treat on this do I need to use a box or other logic.
Thank you
Lony/* Formatted on 7/27/2012 6:13:20 PM (QP5 v5.139.911.3011) */ WITH t AS (SELECT 'RA1650001' col1 FROM DUAL UNION ALL SELECT 'RA1650002' FROM DUAL UNION ALL SELECT 'RA1650003' FROM DUAL UNION ALL SELECT 'RA1650004' FROM DUAL), u AS (SELECT 'RA165A' col1 FROM DUAL) SELECT SUBSTR (t.col1, 1, 5) || CHR ( DECODE ( SIGN ( ASCII (SUBSTR (u.col1, 6, 1)) + TO_NUMBER ( (SUBSTR (t.col1, 9, 1))) - 90), 1, 64 + ASCII (SUBSTR (u.col1, 6, 1)) + TO_NUMBER ( (SUBSTR (t.col1, 9, 1))) - 90, ASCII (SUBSTR (u.col1, 6, 1)) + TO_NUMBER ( (SUBSTR (t.col1, 9, 1))))) || SUBSTR (t.col1, 6) res FROM t, u WHERE SUBSTR (t.col1, 1, 5) = SUBSTR (u.col1, 1, 5);
Published by: Indra Budiantho on July 27, 2012 04:14
-
Dynamic sorting (no CASE statement)
Greetings,
I am struggling to find a good solution to something that seems like it has been done before. I would like to pass a parameter to a stored procedure that represents a position of column to sort the results. For example:
CREATE OR REPLACE PROCEDURE XXX
(
RESULTS ON SYS_REFCURSOR,
P_ORDER_COL NUMBER: = 0;
)
Returns the results sorted by P_ORDER_COL. I can replace it with the value in a query window and get the correct results, but not a chance in a stored procedure. Thank you.
One thing. I don't want to use a case statement for sorting. I would like something more flexible than this approach
Published by: user10940616 on April 20, 2009 17:37Hello
I have a simple example (concentrated in sorting by column):
CREATE OR REPLACE PACKAGE PACK_TEST IS TYPE t_cursor IS REF CURSOR; PROCEDURE proc_sort_by_colum(p_column_pos IN NUMBER, p_sql IN VARCHAR2, p_cursor OUT t_cursor); END PACK_TEST; / CREATE OR REPLACE PACKAGE BODY PACK_TEST IS PROCEDURE proc_sort_by_colum(p_column_pos IN NUMBER, p_sql IN VARCHAR2, p_cursor OUT t_cursor) IS v_sql VARCHAR2(4000); BEGIN v_sql := p_sql || ' ORDER BY ' || p_column_pos; OPEN p_cursor FOR v_sql; END proc_sort_by_colum; END PACK_TEST; /
Kind regards
-
Field values for replacement Case statement
Hey,.
I need assistance with a CASE statement to display some values of field based on another field value.
This is data of table DEPT
It comes to my select statement.DEPTNO DNAME LOC 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON
When I Uncomment the two lines I get an error message. The results areSELECT DEPTNO, DNAME, (CASE LOC WHEN 'NEW YORK' THEN '' --WHEN LOC = 'NEW YORK' THEN DEPTNO = '' --WHEN LOC = 'NEW YORK' THEN DNAME = '' END) AS LOC FROM DEPT
I don't want to delete all the values for the LOC. I want to display a value for DEPTNO and DNAME If LOC = "NEW YORK". Has anyone ever done this before?DEPTNO DNAME LOC 10 ACCOUNTING - 20 RESEARCH - 30 SALES - 40 OPERATIONS -
Good results...DEPTNO DNAME LOC - - NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON
Like this?
SQL> ed Wrote file afiedt.buf 1 SELECT CASE WHEN LOC != 'NEW YORK' THEN DEPTNO END AS DEPTNO 2 ,CASE WHEN LOC != 'NEW YORK' THEN DNAME END AS DEPTNO 3 ,LOC 4* FROM DEPT SQL> / DEPTNO DEPTNO LOC ---------- -------------- ------------- NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON 50 IT SUPPORT LONDON SQL>
-
I'm considering buying a MacBook Pro 15 inch. I use programs such as Stata, for big calculations. What is my best option?
Either of the 15 "MBPr come with 16 GB of RAM and because it appears that RAM is paramount for Stata then one of them should be able to manage it.
Is the portability of paramount importance for you? If this isn't the case, you might consider an iMac. You get more for your money from a laptop to a desktop computer. In addition, the RAM on the iMac can be improved if need more later. From what I've read on Stata resembling an important consideration.
-
Use the control of timing DAQmx as input in case statement
Hello
I'm building a VI aquire sampled under tension of a sensor in continuous mode or finished. I was going to do this, use a box with a cable of the sample mode of the VI DAQmx calendar entry to the terminal State, the idea being that I couldn't aeither a while looping the case for continuous or simple acquisition according to the setting of this command.
However, instead of the sample mode provided for in the case of the case statement, I just get 1 and 0.
It's a good way to achieve this, and if so how can I get my case structure working properly?
Thank you
Dave
Hi Dave,.
Apologies - I consider that the error is from the data acquisition function? I forgot that she was using the sample entry mode.
Perhaps, then, it will be preferable to continue using the control of the ring - cases will be numbered and will correspond to the numeric value of the selection of the ring (i.e. finite samples = 0). I have attached a small example if we know not.
Moreover, the structure of the case cannot automatically fill for each case, in which case you can right click on the structure of the case-> add the case after.
Best regards
-
call the statement box inside the case statement
I am writing a program which requires me to run a statement box inside another case statement. Although this sounds like a simple thing, I need to be able to call the case statement using a sequence structure, where s1 sends the true value to the case, s2, a fake. Then I need to record the results of this instruction box in a text file. Attatched is a simplified version of what I'm trying to do. Please note that the way my program runs may not call the case statement without using a sequence structure, two nesting box instructions is not feasible. I hope someone out there can help me because I was stuck trying to find this for awhile.
Thank you
LVStudent wrote:
[...] I can't call the case statement without using a sequence structure
Yes you can. You just need to be smart.
LVStudent wrote:
I don't think I can use a state machine to fix this.
I think you probably can.
With respect to your original post. What are these s1 and s2 are you talking about? My opinion on the matter, it is that you want to select a case based on the values of several controls Boolean. If this is correct, I do this:
Build your Boolean controls in a table, convert the table number and insert it into the structure of your business. No button pressed = 0, s1 = only 1, s2 = only 2 both = 3. This works for Boolean values as much as you want and is an easy way to make a decision that depends on many entries.
-
Case statement is not spend.
Hello
I'm having a strange problem with a case statement. I'm passing is a Boolean value that is set to false, but the case statement never switches to the loop of "false". I have attached a word doc who did the screen has a step of this unique through being shot. The photo of the top has the case highlighted with the probe #8 beside him indicate 'False. ' In the lower screen shot is the very next step that highlights the outside circle while ' loop', but the case statement is always 'True '. Anyone seen this before?
Gary Tyrna
Hey Mello,
Well, I see what you're saying and you are right, the problem is the case statement works when highlight of execution. But I have a main case statement in the loop that either allows the state machine to execute a loop or hides them and that case is triggered for no steps to true or false. So that was the reason why I sent the first e-mail because I could see this case change, but not the smallest. But if this is the fix well I'll run with it and lets see case statement switch the highlight of the performance.
Thanks again.
Gary Tyrna
-
How can you change a menu drop-down menu in a case statement?
Hello
I'm trying a table find vi. This VI will be an existing xml file and once the user has selected access to its equipment, input, output and frequency it put all of these options in a string and search the XML for this exact table name and post it on one screen of output. The problem I have is my entry and exit selection must be a little different depending on the chosen equipment. I thought I could use an instruction box to change the options of selectable input and output, but I ran into snags a lot with it. For whenever I have to put a new drop of entry and exit in the drop-down menu in the case statement, he wants to put a new one in the front (I only want to enter and exit not only three I have two inputs and outputs hidden right now). I think I'm using the wrong case statement... Can someone help change my input and output, selectable options depending on the chosen equipment. Attached is my xml file, Array Find.vi (the original) and table Find_Test.vi (that's what I'm trying to change).
Thank you
dlovell
Hi dlovell,
A few changes in the attached VI:
Requirements/possible Solutions
- When the value of the equipment, do something
- Add the cases to the value of equipment change event
- Do something = decide what channels to write, to change the input and output strings
- Read material value changed
- Decision (case structure)
- Channel (same method as the previous mod)
Hope this helps
-
How to fill a table only if a case statement runs?
Hello. I want to have a while loop with a case statement. When the case is true, it should read the analog data each iteration of the while loop via Daqmx and store these values in a table. If the case is wrong, I don't want to read all the data or to store anything else in the table. When the loop is finished, I want to have this available table to write to a file or something. How can I go about it?
Search for a "shift register. This will hold your data. In the case of fake feed the data in the table back through without change. In the case of true add the new value in the table to "build the table" or even better "subset of the table to replace' for a defined table size.
-
How can I write a case statement if I want a case for x< 1.5; ="" a="" case="" for="" 1.5=""><= x="">=><= 3.7; ="" case="" for ="" 3.7="">=>< x="">< 7.2.....etc. ="" my="" input="" is="" a="" floating="">
Thank you.
You don't seem to have set rules on inclusion, but I often use the function in the range and Coerce in these cases.
-
Can I use a hexadecimal string with a case statement?
Simple question:
Can I enter a hexadecimal string to a case statement and have the case statement see it as hex?
I understand that I could convert the hexadecimal string to a number and then enter the hexadecimal number to the case statement but I am curious to know if I could have the case see the string itself as hex without this added feature.
Would be nice to not have to convert all my numbers throughout my code strings
Thank you
-Eric
How long are the strings? Since you mention convert in numbers, they are probably short and all of same length.
Are there different possible channels how?
Case header includes \-codes in the case of a label deal selector As string, so that should be enough for your use. For example this code turns the LED (.. .so that a simple string of "\00\00" of wiring would not be!)
(See also the last sentence of the "enumerated values" section of the help).
-
I lost my CD key for Age of Mythology
I recently decided to re - install Age of Mythology on my computer, but I can't find my CD key, or even the box also. The two discs are in CD cases, but I must have forgotten to save the key. There is probably nothing to do, but I thought it can't hurt to ask.
Hi Alicesjasper,
Welcome to Microsoft Windows Vista Forums.
You may need to contact the customer in order to obtain a new product key for Age of Mythology game.
To contact customer care using the information provided in the link http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms
All the best!
Thank you, and in what concerns:
Diana D D - Microsoft technical support.
Visit our Microsoft answers feedback Forum and let us know what you think.
-
Case statement in the process Page
Request Express 3.2.1.00.11
I put the following code in an anonymous block (will return no error) for a process Page;
BEGIN INSERT INTO DAD_ASSESSMENT_REQUEST ( tenure_id , client_id ) VALUES ( :P10101_TENURE_ID , :P10101_CLIENT_ID ); END;
But when I put a statement case it throws the following error;
1 error has occurred ORA-06550: line 7, column 3: PL/SQL: ORA-01747: invalid user.table.column, table.column, or column specification ORA-06550: line 3, column 1: PL/SQL: SQL Statement ignored
BEGIN INSERT INTO DAD_ASSESSMENT_REQUEST ( tenure_id , client_id , (CASE WHEN (:P10101_MEASURE_OPTION = 'AREA') THEN estimated_area_ha WHEN (:P10101_MEASURE_OPTION = 'LINE') THEN estimated_length_km END) ) VALUES ( :P10101_TENURE_ID , :P10101_CLIENT_ID , :P10101_X ); END;
Why is this code not work and it is possible to use a case statement in a Page Apex process
Concerning
Ben
Benton says:
Request Express 3.2.1.00.11
I put the following code in an anonymous block (will return no error) for a process Page;
- BEGIN
- INSERT
- IN DAD_ASSESSMENT_REQUEST
- (tenure_id
- client_id
- )
- VALUES
- (: P10101_TENURE_ID)
- ,: P10101_CLIENT_ID
- );
- END;
But when I put a statement case it throws the following error;
- 1 error has occurred
- ORA-06550: line 7, column 3: PL/SQL: ORA-01747: specification user.table.column, table.column or invalid column ORA-06550: line 3, column 1: PL/SQL: statement ignored
- BEGIN
- INSERT
- IN DAD_ASSESSMENT_REQUEST
- (tenure_id
- client_id
- (CASE
- WHEN (: P10101_MEASURE_OPTION = 'SPACE') THEN estimated_area_ha
- WHEN (: P10101_MEASURE_OPTION = 'LINE') THEN estimated_length_km
- END)
- )
- VALUES
- (: P10101_TENURE_ID)
- ,: P10101_CLIENT_ID
- ,: P10101_X
- );
- END;
Why is this code not work and it is possible to use a case statement in a Page Apex process
Of course, it is possible to use a CASE statement or expression (it is the latter) in a page APEX process. However, it is not possible to use an invalid syntax while doing so. Part of a clause INSERT INTO can contain only static column names.
In general the SQL expressions (and also the bind variable, another cause frequent errors of syntax) can be used only in
- the projections of the SELECT queries and subqueries
- the right side of the disposals in the SET update clause
- the lists of VALUES of INSERTs
- WHERE clause predicates
ReemaPuri wrote:
Try this
INSERT
IN DAD_ASSESSMENT_REQUEST
(tenure_id
client_id
estimated_area_ha
estimated_length_km
)
VALUES
(: P10101_TENURE_ID)
,: P10101_CLIENT_ID
, (SELECT CASE WHEN: P10101_MEASURE_OPTION = 'SPACE' AND THEN: P10101_X)
OTHERWISE, NULL END OF DOUBLE)
, (SELECT CASE WHEN: P10101_MEASURE_OPTION = 'LINE' THEN: P10101_X)
OTHERWISE, NULL END OF DOUBLE)
);
It's a good idea, but it can be simplified, eliminating unnecessary subqueries:
insert into dad_assessment_request ( tenure_id , client_id , estimated_area_ha , estimated_length_km) values ( :p10101_tenure_id , :p10101_client_id , case when :p10101_measure_option = 'AREA' then :p10101_x end , case when :p10101_measure_option = 'LINE' then :p10101_x end);
Maybe you are looking for
-
can I uninstall internet explorer 8, after the installation of Foxfire
I just installed Foxfire. I love it and want to keep it as my browser permanate. My question is if I can remove Internet Explorer 8. Thank you Walter Spain
-
Error-124102 when the action on the download
I use action on download put some files on target RT. When I use the reference of the action on the download, all results of action by error-124102. Refrence seems to be valid, when I cast to I16, the value is 1. But if I open the session manually (w
-
Hello! I have acer aspire 1414lc with windows xp and I can not find the drivers for: enthernet controller mass storage controller modem PCI video controller video controller (vga compatible) If anyone knows where I can find I would be very happy Good
-
E2000 Gigabit connection to the modem
Hello I use an E2000 connected to a DSL modem through the internet port. My modem is able to connect at gigabit speed, but it doesn't seem to be the case with the E2000. All other ports are running at speed gigabit without problem. Y at - it all sett
-
How to open the moff files?
I recently bought a sony hd camera component snap. After loading photo PMB Manager what he came up with, some of my existing photos and videos have been converted to moff files. Can I convert their return? How can I avoid this happening again? Should