How to create a Column that will "carry over" values
I have the first 5 colums of the following table and I would like to create the last column (Carryover). The calculation for carryover (current row) is PRIOR_DAYS_OF_SUPPLY(current row)-DAYS_BTW_REFILL(current row)-carryover (prior row)
This is tricky since the value is dependent on the prior row value of the SAME column. I have tried the window functions but still cannot get it to work.
P_ID RX_DATE DAYS_OF_SUPPLY PRIOR_DAYS_OF_SUPPLY DAYS_BTW_REFILL CARRYOVER
100 10/20/2005 30 0
100 11/28/2005 30 30 39 0
100 12/21/2005 30 30 23 7
100 1/13/2006 60 30 23 14
100 3/3/2006 30 60 49 25
100 4/14/2006 30 30 42 13
100 6/9/2006 30 30 56 0
100 7/7/2006 30 30 28 2
100 7/31/2006 30 30 24 8
200 10/20/2005 30 0
200 11/28/2005 30 30 30 0
200 12/21/2005 30 30 35 0
200 1/13/2006 60 30 25 5
200 3/3/2006 30 60 70 0
200 4/14/2006 45 30 32 0
200 6/9/2006 30 45 41 4
200 7/7/2006 30 30 30 4
200 7/31/2006 30 30 32 2
Any help would be greatly appreciated,
Sam
I may not be explaining my issue well enough. I believe that 10g has new funciontality that can solve this. Since I am in 9i, I would like to have something that does the same thing as the following 10g SQL:
create table foo (P_ID number(3) ,R_DT date , DOS number(3) ,
PDOS number(3), DBTWR number(3), CO number(3));
insert into foo values (100,to_date('10/20/2005','mm/dd/yyyy'),'30',0,null,null );
insert into foo values (100,to_date('11/28/2005','mm/dd/yyyy'),'30','30','39',0);
insert into foo values (100,to_date('12/21/2005','mm/dd/yyyy'),'30','30','23',7);
insert into foo values (100,to_date('01/13/2006','mm/dd/yyyy'),'60','30','23',14);
insert into foo values (100,to_date('03/3/2006','mm/dd/yyyy'),'30','60','49',25);
insert into foo values (100,to_date('04/14/2006','mm/dd/yyyy'),'30','30','42',13);
insert into foo values (100,to_date('06/9/2006','mm/dd/yyyy'),'30','30','56',0);
insert into foo values (100,to_date('07/7/2006','mm/dd/yyyy'),'30','30','28',2);
insert into foo values (100,to_date('07/31/2006','mm/dd/yyyy'),'30','30','24',8);
insert into foo values (200,to_date('10/20/2005','mm/dd/yyyy'),'30',0,null,null);
insert into foo values (200,to_date('11/28/2005','mm/dd/yyyy'),'30','30','30',0);
insert into foo values (200,to_date('12/21/2005','mm/dd/yyyy'),'30','30','35',0);
insert into foo values (200,to_date('01/13/2006','mm/dd/yyyy'),'60','30','25',5);
insert into foo values (200,to_date('03/3/2006','mm/dd/yyyy'),'30','60','70',0);
insert into foo values (200,to_date('04/14/2006','mm/dd/yyyy'),'45','30','32',0);
insert into foo values (200,to_date('06/9/2006','mm/dd/yyyy'),'30','45','41',4);
insert into foo values (200,to_date('07/7/2006','mm/dd/yyyy'),'30','30','30',4);
insert into foo values (200,to_date('07/31/2006','mm/dd/yyyy'),'30','30','32',2);
================
Quote:
select p_id,r_dt,dos,pdos,dbtwr,cry
from foo
model return all rows
main grr
partition by ( p_id)
dimension by (row_number() over
(partition by p_id order by r_dt ) as rn )
measures (r_dt,dos,pdos,dbtwr,co, 0 as cry )
ignore nav rules sequential order
cry[any]= case when (pdos[cv()]-dbtwr[cv()] +cry[cv()-1])
< 1 then 0
else pdos[cv()]-dbtwr[cv()]+cry[cv()-1]
end
)
Similar Messages
-
How to create a function that will return a value of a JComboBox PLEASEHELP
this is my psuedo code,. but it's still not worked. Plase help..
String vpText;
String abc = getit();
String s_alert[] ={"WARNIGNS","CAUTIONS","NOTES"};
JComboBox CBweapon = new JComboBox();
for (int i=0;i<s_weapon.length;i++) {
CBweapon.addItem (s_weapon);
private String getit(){
CBweapon.addActionListener(new ActionListener (){
public void actionPerformed(ActionEvent e){
wpText = (String)CBweapon.getSelectedItem() ;
return;
return wpText;Maybe I'm missing some subtle point here, but why not just do this:
private String getit(){
return CBweapon.getSelectedItem() ;
It doesn't make sense to me to have a method which calls actionListener like this, as if you are going to be calling it over and over again. You want to only call actionListener(...) ONE time, and every time an event is triggered, that code will be executed automatically. -
How to create a form that will allow the applicant to upload their photo
I have Adobe Acrobat 9 Pro Extended and I know how to create forms that require text input.
How to create a form that will allow the applicant to upload their photo? I alo wish to know how to upload a photograph so that I can test the form I created.
Thank you
Adrian Wattstest@ORA10G> with x as (
2 select '234-1111' as customer, to_date('2-Jan-2008','dd-Mon-yyyy') as call_date, 'Order product' as reason from dual union all
3 select '234-1132', to_date('3-Jan-2008','dd-Mon-yyyy'), 'Request info' from dual union all
4 select '231-1154', to_date('4-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
5 select '234-1111', to_date('2-Nov-2007','dd-Mon-yyyy'), 'Order product' from dual union all
6 select '234-1132', to_date('9-Jan-2008','dd-Mon-yyyy'), 'Request info' from dual union all
7 select '231-1154', to_date('9-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
8 select '234-1111', to_date('5-Dec-2007','dd-Mon-yyyy'), 'Order product' from dual union all
9 select '234-1131', to_date('7-Dec-2007','dd-Mon-yyyy'), 'Request info' from dual union all
10 select '231-1154', to_date('1-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
11 select '234-1111', to_date('8-Jan-2008','dd-Mon-yyyy'), 'Order product' from dual union all
12 select '234-1131', to_date('3-Dec-2007','dd-Mon-yyyy'), 'Request info' from dual union all
13 select '231-1154', to_date('4-Nov-2007','dd-Mon-yyyy'), 'Forward to Sales' from dual)
14 --
15 select customer,max(call_date), reason
16 from x
17 where reason = 'Request info'
18 group by customer, reason;
CUSTOMER MAX(CALL_ REASON
231-1154 09-SEP-07 Request info
234-1131 07-DEC-07 Request info
234-1132 09-JAN-08 Request info
test@ORA10G>
test@ORA10G>pratz -
How to create a program that will accept a series of strings of 0 and 1 onl
how to create a program that will accept a series of strings of 0 and 1 only then displays 0 as 48 and displays 1 as 49.
Isn't one thread enough for your homework?
http://forum.java.sun.com/thread.jspa?threadID=5253850&messageID=10051155#10051155 -
How to create a column that automatically creates a serial number?
How can I create a column that creates a serial number for each entry?
you could do something like this:
I assumed that the serial number only needs to be present if you have entered some information in the other columns of the corresponding row.
A2=IF(COUNTA(2:2)>0, REPT("0", 6−LEN(ROW()−1))&ROW()−1, "")
this is shorthand for... select cell A2, then type (or copy and paste from here) the formula:
=IF(COUNTA(2:2)>0, REPT("0", 6−LEN(ROW()−1))&ROW()−1, "")
To fill down:
select cell A2, copy
select column A by clicking the columne header (the "A" at the very top)
unselect cell A1 by holding the command key while single clicking cell A1
paste -
I need instructions on how to create a button that will email a pdf form to someone else on a websit
I NEED ASSISTANCE CREATING A BUTTON THAT WILL EMAIL A PDF FORM FROM A WEBSITE TO WHOEVER THE VIEWER WANTS TO
Just a bit more info. E-mail can be used, but has potential problems -- often related to the client machine that you have no control over. Use the data submissions (either FDF or XML) rather than the full PDF so you do not have to deal with Reader Rights and the related license issues. The FDF and XML data files are easily imported into the original form so that you see what the client sees. With those aspects in mind, just go ahead and try one. Be aware that you can add form fields using the form tools in the Advanced Editing tools, OR use the forms menu that will take you to Designer. You might want to try both to see the pros and cons. Be sure to keep such a test simple so you are not wasting time on your final form just for testing. I typically create a 1 page form that has all of the possible fields for such a test.
-
How to create an action that will crop two sections from one scanned image?
I'm trying to create an action that will automate the process of cropping the left and right pages from a series of two-page book scans.
I tried to create a 2 step action which first crops the left half of a scan (by setting the left margin to 0in and the right margin to 6in) and then the right half of the scan (by setting the left margin to 6in and the right margin to. 12in), however when executing, only the left half appears to be cropped.
I imagine this is due to the fact that once one side of the initial scan is cropped, the other side disappears.
Is there any way around this?Basically i need to create a new document out of a folder full of images.
You may have to look into Scripting to achieve something like this.
You could ask in the Scriptimg Forum
Photoshop Scripting
But maybe it would suffice to insert the Menu Item
File – Scripts – Load Files into Stack
into the Action and then iterate through the Layers with [ or ] and reset the opacities and Blend Modes – but as Actions would not be able to change the number of repetitions of the operation conditionally a custom Script would still seem preferable. -
Searching for how to create a page that will recreate it self and image uploader!
Greetings,
Does any one knows how I could create client side page that would always recreate it self when a new clients to signs up and become a member to my blog site, so they could manage and add friends to their page and upload image to their album? The idea is to have pages added like it is on Facebook, when a member signs up.
If I server side software is need in order to achieve this goal; what type of server side software do I need for this design? Please contact me if you have any idea.
I also would like to receive any information on where to find script that will help visitors upload images to my site.
I have done with other parts of my web design adding this idea is all I need to finish. Your help is immensely appreciated.
Joplateau.You may want to ask in a more generalized forum such as http://forums.adobe.com/community/design_development/webdesign. This one is specifically for Adobe Contribute (which won't do what you want) and is seldom visited. Good luck.
-
How to create an easteregg that will reveal an image
I created a flash movie which resembles a control panel. I created a image of the group of people that worked on the project and I want the image to be hidden until the user types a key combination that would trigger the image to appear and dissapear when clicked. This url is something like what I was looking for, (www.virtualmarketingblog.com/how-to-create-alert-boxes-in-flash/) but I want an image to appear instead, can this be customized? The only problem is, I'm not really good at actionscript. Is there any tutorials out there that may show an easy way to do this. The attached file is a sample of my interface.
Thankshere's code for multikey as2 detection:
http://www.kirupa.com/forum/showthread.php?t=211149 -
How to create dynamic stamp that will prompt for Cause number and exhibit number?
I have a need to have a three line custom stamp that will look like the following but will allow a user to input the Cause number then the exhibit number, then successively number exhibits that the stamp is applied to:
EXHIBIT
12:74130
001
Exhibit will always be the same, but the cause number would need to be modifiable per batch possibly and I would like to be able to update the exhibit number to have a unique number on each page of exhibits....or just each exhibit.
Can that be done?
thanks!It sounds like you are trying to use a retail serial as an enterprise serial and would like to bypass it's restrictions by deactivating it . . . I assume that's not possible, but perhaps I don't understand your issue.
I doubt you'll get a good answer on the forum. Try support, your sales rep, or a help link on the licensing web site (if there is one).
Ben -
How to create a dimension that will reference another dimension
Im creating a new cube without having a schema or DSV in place yet. Starting from scratch. In my OLTP database I have a table 'Orders' which contains various FK references to other tables, which in turn might reference two other tables.
For example. Orders has a FK to a table called MarketAuthority. This is a table that contains references to two other tables Market and Authority.
How can setup my dimension(s) to capture this, if Im starting with no DSV or schema for a data warehouse.
Correct me if Im wrong, but I think I just setup a new dimension called MarketAuthority and use it from the Measuregroup for the Orders. However, how will I reference the Authority. I assume it will be a dimension as well, but how do I relate
MarketAuthority and Authority?
In other words, say you had these types of tables in your OLTP system
Orders (salesperson, account, department ...)
OrderDetails (references order, many to 1)
Goals (references many of the same attributes eg. salesperson as order)
Im thinking I need 3 separate measure groups?
Im looking over the Adventureworks 2008 SSAS example project for how its setup.I think im looking at this all wrong.
Again, with the example tables above, I can still create 3 different measure groups, but they all will need to reference some of the same dimensions. This will result in 3 different fact tables when the schema is realized I believe?
What I think i was missing was that something like an OrderDetail table, that refers back to an Order will need references also to the same attributes as the order, at least as regard to the fact table(s).
In other words, if Orders has a SalesPerson key, account key etc, then OrderDetails will as well, IN ADDITION TO the order id as a measure.
Or ... does this sound like the case for a Fact type dimension?
https://msdn.microsoft.com/en-us/library/ms167409(v=sql.105).aspx
Hi Shiftbit,
As you said, it related to Degenerate dimensions which also called fact dimensions, are standard dimensions that are constructed from attribute columns in fact tables instead of from attribute columns in dimension tables.
http://www.jamesserra.com/archive/2011/11/degenerate-dimensions/
Regards,
Charlie Liao
TechNet Community Support -
HELP!How to create HD disc that will play back in HD DVD or Blu-Ray player?
Footage comes from Panasonic HVX200 as DVCPRO HD 1080i60, all appropriate settings made in FCP5 to edit. Have already made SD DVD, whoopie.
Now client is interested in real HD version that they can play back on HD DVD or Blu-Ray set top unit. Of all my research, I've discovered little about how to make a "real" HD video disc. OSX doesn't support Blu-Ray burning, OK. What about HD DVD burning support? And what drive to purchase for this application?
I understand DVD Studio will allow me to author a disc with HD content...that I can burn onto DVD5. Useless to the client. Need to burn on either Blu-Ray or HD DVD media.
Aside from encoding in Compressor, what do I do when I need to make this HD disc happen? Compressor step seems easy enough to figure out. Just very unclear on how to burn out appropriate video disc.
Thanks for your help.For Blu-Ray creation:
I'm curious if DVDit! works in parallels too, though it will certainly work in BootCamp. The question is what format should FCP/Compressor output to in order for DVDIt, etc. on BC or Parallels need in order to create the disc?
MPEG-2 and H.264 should work, but who knows?
In the meantime, I have HDV source footage that I edit. I print the final edit back to HDV for archiving, and burn a HD-DVD on a DL DVD+R red laser disc to show on my Toshiba HD-DVD player using DVDSP. It works, and I can get about 40 minutes of MPEG-2/HDV on there without transcoding at 1080i and it looks fantastic.
In the future, I hope to be able to dump the HDV final edit onto a Blu-Ray disc. I'm guessing Adobe Encore will be needed on the Mac for that.
The point here is there certainly are options that work. I do wish Apple added Blu-Ray burning capability.
There's still room for that, however... FCS 1 (and even now 2, with AVCHD support, albeit non-native) have histories of adding new support for codecs, etc. in free updates. -
How to create an image that when scrolled over automatically scrolls between 3 image
What i am trying or rather what i want to achive is, when an image is scrolled over it automaticly scrolls between 3 pictures and when it is rolled off of goes back to a specific image. How do i do something like this i know its going to have to be a javascript item, but how do i do it?
Hi Gramps,
Welcome back. Haven't seen you around for a while.
Please have a look here and tell us if there is a script that comes close to what you want.
Did you forget to add something?
Nancy O. -
How to create a characteristic that can hold decimal values.
Hi,
I want to create a characteristic which shoul be able to hold decimal values.
Because from source system its coming in the format Number(1,1) and it should be a characteristics as per my
business requirement.
Please give me the solution if u know.
Thanks,
VijayaHi,
it depends on your requirements... there are two possibilities
1. type CHAR - displays the values as they are coming from source system, but I do not think any further calculations will be possible
2. type NUMC - you can multiply each value from source system with 10 to derive an Integer value if you have format 1,1 for all records. The values will not be displayed as decimals but you can apply further calculations if needed (and divide all numeric values by 10 to transform back to correct decimal value)
Please elaborate on your requirements, maybe you can meet your requirements using a decimal key figure...
@Manfred
I think type amount will be available only for key figures, not for characteristics?
Best regards,
Björn -
Display a Custom Sum that will Ignore Certain values
In addition to the sum that I am computing on Current Total Column in SQL Plus, I also want to do a Custom Sum on Current Total Column that will ignore certain values of the Current Total column, but displays at the same frequency as the break group. How can I do it in SQL Plus?
Hi!
I think you can use DECODE or user-defined function to create an artificial output column in your query ignoring certain values of the Current Total column and then just compute sum on it as you did on Current Total.
Regards,
Andrew Velitchko
BrainBench MVP for Developer/2000
http://www.brainbench.com
Maybe you are looking for
-
How can i change column header value dynamically in IR report
HI, I have created report with the help of collections. Report query has been changing dynamically but i got problem with report header names and headers names has not been changing dynamically it is always showing like c001,c002....etc so, i have cr
-
I am buying a new Dell PC with Elements version 12 pre-installed. Then I have to move my Elements version 5 documents to the new computer. I need to know any precautions, suggestions, etc. that you may have.
-
Bacground job cancelled in Solman system.
Hi experts, Two bacground job cancelled in Solman system. 1. SM:SELFDIAGNOSIS Job started Step 001 started (program RDSWP_SELF_DIAGNOSIS, variant &0000000001018, user ID SAP*) ABAP/4 processor: MOVE_TO_LIT_NOTALLOWED_NODATA Job cancelled 2.SM:SYNC SA
-
Javascript not working in Mid-2010 Macbook Pro
Javascript says it's enabled in my browsers (Firefox, Chrome, Safari), when I go to a website that tells you if your javascript is enabled or not, it says it's enabled, but it doesn't work when I go to a website that uses it. How do I fix this issue?
-
Why is navigation bar hidden in safari
Why is the navigation bar hidden in safari?