Calculate the length of the median line of the polygon
How to convert the polygon to the central axis to calculate its length?I assume that you are not after the length of the bounday of a polygon, but the length of a median line after its construction of a polygon?
Oracle 11 g 2 has no such ability. He can do it in 12 c but no one knows what's next for this version, in space.
I was contacted several times on the implementation of an algorithm of centerline for my Oracle Spatial to 4 Companion (SC4O) the software free. It is possible that this example of wikipedia shows:
https://Commons.wikimedia.org/wiki/file:Medial_axis_example_2d.svg
But I am not prepared to implement such an algorithm without actuals) 1 and 2) some kind of inducement.
concerning
Simon
Tags: Database
Similar Questions
-
Calculate the length of the lines of text
In a script, I'm inserting text which is a 4 line poem. Each line except the last ends with a hard return ('\n'). I would like to calculate the length (in inches or in another unit of length) of each individual line to find the longest line and adjust the left indent accordingly. Is it possible to get the length of a line of text in a script?
Thank you!
A return is \r
\n is a soft return
Take a look through the comments here
http://InDesignSecrets.com/setting-poetry-flush-left-Center-on-longest-line.php
-
How to calculate the height of LabelField when it displays in multi lines
Hello friends,
We use LabelField.getPrefereredHeight () to calculate the height of the label field. But he returned the same value when it is displayed online singel or multi line.
Please help me for differing from the height of the label while displaying field multi-line and single-line
Thank you very much in advance
If the code is simple, then you might want to go ahead and post it. I can't really speculate on exactly the problem in this case unless I see code. It doesn't sound like you should not show the width and height of your Manager 1 however. Here is an example of a sublayout of one of my managers:
protected void sublayout(int width, int height) { int numFields = getFieldCount(); int availableHeight = height; int totalHeight = 0; for (int i = 0; i < numFields; i++) { Field field = getField(i); layoutChild(field, width, availableHeight); availableHeight -= field.getHeight; totalHeight += field.getHeight(); } setExtent(width, totalHeight); }
This code is educating the Manager to use the full width so much to her and didn't use as much height as it needs (drunk on her children and adding up their respective Heights). I don't know if this helps, but if you have any other questions please do not hesitate to post the code and we'll see what happens.
-
calculate the time difference between several lines
Hello
I have a table as below:
create table select TEST_CASETBL (ID, CASE_NUM, CASE_STATUS, CASE_SUB_STATUS, LAST_UPD_DTTM)
112, 123-456', 'open', 'Work', TO_DATE (11 March 2015 13:00 ',' dd/mm/yyyy hh24:mi:ss') of the DUAL union all select
113, 123-456', 'Open', 'pending on the admin', TO_DATE (10 January 2015 15:00 ',' dd/mm/yyyy hh24:mi:ss') of the DUAL union all select
114, 123-456', 'Open', 'client expectation', TO_DATE (10 July 2015 09:00 ',' hh24:mi:ss' of dd/mm/yyyy) of the DUAL union all select them
315, 123-456', 'open', 'Work', TO_DATE (September 15, 2015 10:00 ',' dd/mm/yyyy hh24:mi:ss') of the DUAL union all select
219, 123-456', 'Open', 'pending on the admin', TO_DATE (January 9, 2015 08:00 ',' dd/mm/yyyy hh24:mi:ss') of the DUAL union all select
651, 123-456', 'open', 'Work', TO_DATE (August 20, 2015 10:00 ',' dd/mm/yyyy hh24:mi:ss') from DUAL;
I would like to calculate the duration total (days ideally) to CASE_SUB_STATUS, so have a set of lines:
CASE_NUM of work waiting on admin waiting on customer
-------------------------------------------------------------------------------------------------------------------------------------------------------
123-456 70days 6 hours
Here is the explanation of the pattern:
ex: for everyday business computing (timestamp timestamp of ID:651 - ID:219) +(timestamp of ID:315-timestamp of ID:114) + (ID:112 stamp - current_time) = 11 days + 21 days 22hrs 23hrs 36 days 9 hours
still waiting on admin
(ID:219 timestamp - timestamp of ID:315) + (ID:113 timestamp - timestamp of ID:112)
still waiting on the client
(ID:114 timestamp - timestamp of ID:113)
I would appreciate any idea how to solve this, ideally as an SQL
Thank you
Should he not?...
with test_casetbl (id, case_num, case_status, case_sub_status, last_upd_dttm) as)
Select 112, 123-456', 'Open', 'Work', TO_DATE (11 March 2015 13:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 113, 123-456', 'Open', 'pending on the admin', TO_DATE (10 January 2015 15:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 114, 123-456', 'Open', 'client expectation', TO_DATE (10 July 2015 09:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 315, 123-456', 'Open', 'Work', TO_DATE (September 15, 2015 10:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 219, 123-456', 'Open', 'pending on the admin', TO_DATE (January 9, 2015 08:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 651, 123-456', 'Open', 'Work', TO_DATE (August 20, 2015 10:00 ',' the hh24: mi: ss' dd/mm/yyyy) double
),
t like)
Select case_num,
case_sub_status,
(last_upd_dttm, 1, sysdate) ahead of diff last_upd_dttm (partition by order of last_upd_dttm case_num).
of test_casetbl
)
Select case_num,
trunc (a) | "day (s). TO_CHAR (date ' 1-1-1' + a, "fmhh24" 'mi' minute (s) "ss" second (s) hour (s)"") "work."
trunc (b) | "day (s). TO_CHAR (day 1-1-1' + b, "fmhh24" 'mi' minute (s) "ss" second (s) hour (s)"") 'Waiting on admin',
trunc (c) | "day (s). TO_CHAR (day 1-1-1' + c, "fmhh24" 'mi' minute (s) "ss" second (s) hour (s)"") "waiting on customer."
t
pivot)
Sum (diff)
for case_sub_status in)
'Work' is.
B "waiting on admin',
C "customer expectation."
)
)
CASE_NUM Working Waiting on admin Waiting on customer 123-456 63 day (s) 22 hour (s) (s) 50 minute 49 second (s) 19 day (s) on 20 (s) hour 0 minute 0 second (s) 27 day (s) on 4 hour (s) 0 minute 0 second (s) -
How to calculate the length of the video format (seconds)
Hello
I use the ActionScript 3.0 CookBook book and it shows how to calculate the length of a video (and also playing the video in progress) in seconds using the property at the time of the NetStream class.
So, for example, the length of my video is 1070 seconds.
But I want to be able to convert a format such as ' 00 (hours): 00 (mins): 00 (dry) ", '1070 seconds' how can I get this?
Any help is appreciated!
TA :)
Kind regards
M.Hi, thanks for the reply :) you have helped me understand the following code which I just found (and that seemed to work the way I needed it).
Quote:
If (_duration > 0 & _stream.time > 0)
{
_playbackTime.text = generateTime (_stream.time);
}function generateTime(nCurrentTime:Number):String
{
var nMinutes:String = (Math.floor(nCurrentTime / 60)< 10="" "0"="" :="" "")="" +="" math.floor(ncurrenttime="">
var nSeconds:String = (Math.floor (nCurrentTime % 60)< 10="" "0"="" :="" "")="" +="" math.floor(ncurrenttime="" %="">Result set
var sResult:String = nMinutes + ":" + nSecondes;Return value
return sResultat;
} -
query to calculate the value and produce new lines
QUARTER CUSTOMER PRODUCT RETAIL_SALES_AMT WHOLESALE_AMT
01/01/2006 ABC VACUUM CLEANER 454234,00 65633456.00
01/04/2006 ABC VACUUM CLEANER 324562,00 45333234.00
01/07/2006 ABC VACUUM CLEANER 67845423.00 NULL
01/10/2006 ABC VACUUM CLEANER 67453453.00 NULL
01/01/2007 ABC VACUUM CLEANER 56754633.00 NULL
01/04/2007 ABC VACUUM CLEANER 45423434.00 NULL
Hi guys,.
It's a situation where I have to produce a few new lines with projections based on Q4 RETAIL_SALES_AMT
RETAIL_SALES_AMOUNT and fourth ' rs following WHOLESALE_AMT. As you can see from the sample data for a specific customer,
product I have populated only until 01/04/2006 retail_sales_amt but WHOLE_SALE amt for the same product and customer
are there up to 01/04/2007.
I have to produce a PROJECTED RETAIL_SALES_AMT and it must be inserted in a new line with an indicator to identify
a proposed line. Here, in this case I have to produce a new line of projection from 07/01/2006,10/01/2006 and 01/01/2007
the RETAIL_SALES_AMT. The method of calculation is provided for in:
retail_sales_amt scheduled for 07/01/2006=.345+ ((01/07/2006 whole_sales-01/04/2006 whole_sales) / (01/04/2006 whole_sale)))
* 01/04/2006 RETAIL_SALES_AMT and move forward to subsequent quarters.
Is it possible that I can use a query to produce these new lines by calculating the RETAIL_SALES_AMT on the fly, or any other
How to procedure.
Please help as it seems a little complicated.
Concerning
Published by: user626688 on October 27, 2009 11:26
Published by: user626688 on October 27, 2009 11:26
Published by: user626688 on October 27, 2009 11:27
Published by: user626688 on October 27, 2009 11:28
Published by: user626688 on October 27, 2009 11:31
Published by: user626688 on October 27, 2009 11:32Hello
As far as I can tell, that's what you asked for:
WITH got_prev AS ( SELECT table_x.* , LAG (wholesale_amt) OVER ( PARTITION BY customer , product ORDER BY quarter ) AS prev_wholesale_amt FROM table_x -- WHERE ... -- Any filtering goes here ) , tree AS ( SELECT got_prev.* , SYS_CONNECT_BY_PATH ( CASE WHEN LEVEL = 1 THEN retail_sales_amt ELSE ( .345 + wholesale_amt - prev_wholesale_amt ) / prev_wholesale_amt END , '*' ) AS path FROM got_prev START WITH retail_sales_amt IS NOT NULL CONNECT BY retail_sales_amt IS NULL AND quarter = ADD_MONTHS (PRIOR quarter, 3) AND customer = PRIOR customer AND product = PRIOR product ) SELECT quarter , customer , product , COALESCE ( retail_sales_amt , eval_number ( LTRIM ( path , '*' ) ) ) AS retail_sales_amt , wholesale_amt , NVL2 ( retail_sales_amt , 'F' , 'T' ) AS projected_flag FROM tree ORDER BY customer , product , quarter ;
I posted earlier the eval_number function.
In this query, a group of consecutive quarters, where the first group a retail_sales_num and the rest of the members of the group are not, is treated as a hierarchy. The retail_sales_amt of all members (except the first) will be based on the previous, as well as the wholesale_amts past and present.
Say that a tree is 5 points of time (as in your examples of data). We can calculate the 2nd point in several ways: using analytical functions, for example. But we cannot use the same formula to calculate the 3rd point, because the calculation of section 2 must be completed before we can calculate the 3rd. It goes the same for the 4th and 5th.
This is CONNECT BY arrives. CONNECT BY is one thing in Oracle SQL that can be recursively; children may find themselves once their parents are found, in the same way we want to calculate the nth retail_sales_amt once the amount of the n-minus-1 has been calculated. To do this, we use SYS_CONNECT_BY_PATH, where the first element in the path is the retail_sales_amt given, and all others are the factor to multiply this number to get the next amount.
SYS_CONNECT_BY_PATH produces a string like ' * 324562 *. 4965935 *-. 0057739', which should be interpreted as a number. TO_NUMBER won't: TO_NUMBER cannot convert only a single numeric literal. Instead, we have a function defined by the user who put this string dynamically in the SELECT clause of a query, where it is interpreted as a numeric expression. -
How to calculate the difference in lines
Hi, the case is:
Column1 Column2 Column3 column4
C114 00301152 20/07/2010?
C114 00301152 10/20/2009?
C114 00301152 16/06/2009?
I want to calculate the difference of Column3 in 1st place with the second row and second row to the third row column4 unlike
Thank you very much
Luca
Hi, Luca,
user12880276 wrote:
Hi, the case is:
Column1 Column2 Column3 column4
C114 00301152 20/07/2010?
C114 00301152 10/20/2009?
C114 00301152 16/06/2009?
I want to calculate the difference of Column3 in 1st place with the second row and second row to the third row column4 unlike
Thank you very much
Luca
You can use the analytical function of LAG (or LEAD).
For example, if Column3 is a DATE:
SELECT column1, Column2, Column3
, Column3 - (Column3) in ADVANCE ON (ORDER BY Column3) AS days_diff
FROM table_x
ORDER BY DESC - optionally Column3
;
If you would care to post CREATE TABLE and INSERT instructions for the sample data, and then I could test this.
Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?
Column1 and column2 play no role in this problem (except that appear in the output)? If so, you will need to PARTITION BY in the analytical clause.
-
Calculate the sum of the duration stored in format HH24
Dear professionals,
I use Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production. I stored length of certain events in the table TIME_DURATION as as follows (format h24:mi):
CREATE TABLE "TIME_DURATION" ("ID" NUMBER(11,0), "HOURSMINUTES" VARCHAR2(5)); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('5','00:55'); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('7','00:18'); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('9','06:34'); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('15','00:12'); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('17','09:50'); INSERT INTO TIME_DURATION (ID,HOURSMINUTES) VALUES ('41','12:39');
select * from time_duration; ID HOURS ---------- ----- 5 00:55 7 00:18 9 06:34 15 00:12 17 09:50 41 12:39 6 rows selected.
Now, I want to calculate the total time for all events (sum of all specific times). In this case, it should be 30 hours and 38 minutes.
Any help would be much appreciated.
Thanks in advance.
Hello
So, you want to add a number of lines varibale. This sounds like a job for the SUM function. AMOUNT of work on numbers, no channels such as time, so use TO_NUMBER to convert strings to numbers, so you can add them. If you want to display the result as a string, you can use TO_CHAR to convert the sum into a string.
WITH got_total_minutes AS
(
SELECT SUM ((TO_NUMBER (SUBSTR (heure, 1, 2) * 60)))
+ TO_NUMBER (SUBSTR (hour 4))
) AS total_minutes
OF time_duration
)
SELECT TRUNC (total_minutes / 60). ':'
|| To_char (MOD (total_minutes, 60))
, "FM00.
) AS total_hours_minutes
OF got_total_minutes
;
The output is not quite what you asked:
TOTAL_HOURS_MINUTES
--------------------
30: 28
If you really want 30:38', explain how to get it.
This solution assumes that time always is always 5 characters (2 digits, a separator and another of 2 digits) as it is in your sample data.
If your actual data aren't like your sample data, the same approach still works, but the SUBSTR expressions will be more complicated.
adnanBIH wrote:
Dear professionals,
I use Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production. I stored length of certain events in the table TIME_DURATION as as follows (format h24:mi):
- CREATE TABLE 'TIME_DURATION' ('ID' NUMBER (11.0), VARCHAR2 (5)) 'HOUR '.
- Insert into TIME_DURATION (ID, TIME) values ('5',' 00:55 ');
- Insert into TIME_DURATION (ID, TIME) values ('7',' 00:18 ');
- ...
Thanks for posting the CREATE TABLE and INSERT.
ID is a NUMBER, so do not use quotes around it:
Insert into TIME_DURATION (ID, TIME) values (5, ' 00:55 ');
Insert into TIME_DURATION (ID, TIME) values (7, ' 00:18 ');
...
Depending on how you plan to use the hour, you may want to store a NUMBER, also, or maybe an INTERVAL DAY TO SECOND.
-
Illustrator CS3: How to calculate the exact distance between two points?
It comes to my line.
I have to measure its exact length. How can I do?
If I use the measure tool, the cursor does not select the snap points, so I have only an approximate measure.
Is there a quick way to calculate the exact distance between two points?Flying document Info Palette menu: turn on the SelectionOnly and objects. The palette will show you the length.
JET
-
How to calculate the second and minisecond for audio landmark
I'm doing a sound synchronization for the clip audio and video in Flash. I found a tutorial on the web, and it seems to work. However, I do not know how to calculate the second and the mini (deuxieme from mp3 file. The first frame has the following lines to set the duration for each animation:
Import class
Import net.quip.sound.SoundSync;
Stop the main timeline
Stop();
Create an instance of SoundSync
var ss:SoundSync = new SoundSync();
ss.addCuePoint ("IT", 20100);
ss.addCuePoint ("admin", 20000);
ss.addCuePoint ("maintenance", 19800);
ss.addCuePoint ("treatment", 16479);
ss.addCuePoint ("engineering", 14598);
as.addCuePoint ("logo_epa_npdes", 12356);
ss.addCuePoint ("construction", 8967);
ss.addCuePoint ("370 mg/j", 7896);
ss.addCuePoint ("mc_650, 000 ', 5439);
ss.addCuePoint ("130 mg/j", 3254);
ss.addCuePoint ("1938", 2439);
ss.addCuePoint ("vintage_mc", 0);
Use the instance of loading external MP3
ss.loadSound ("Scn04 - 05.mp3", true);
Create a listener object for the
cuePoint and onSoundComplete events
var listener: Object = new Object();
listener.cuePoint = function (): Void {}
Play();
}
listener.onSoundComplete = function (): Void {}
Play();
}
ss.addEventListener ("cuePoint", listener);
ss.addEventListener ("onSoundComplete", listener);
and the soundsync.as file as follows:
Import mx.events.EventDispatcher;
Import mx.utils.Delegate;
class net.quip.sound.SoundSync extends its {}
PROPERTIES
private var _cuePoints:Array;
private var _currentCuePoint:Number;
private var _interval:Number;
private var _intervalDuration:Number;
private var _secondOffset:Number;
Event dispatcher
public var dispatchEvent:Function;
public var addEventListener:Function;
private var removeEventListener:Function;
CONSTRUCTOR
public void SoundSync(target:MovieClip) {}
Super (target);
init();
}
METHODS
private function init (): Void {}
Initialize properties
_cuePoints = new Array();
_currentCuePoint = 0;
_intervalDuration = 200;
_secondOffset = 0;
Initialize the instance of the class as the valid event broadcaster
EventDispatcher.initialize (this);
}
Add Cue Point
public void addCuePoint(cuePointName:String,_cuePointTime:Number):Void {}
() _cuePoints.push
{
type: "cuePoint",.
name: cuePointName,.
time: cuePointTime,.
target: this
}
);
_cuePoints.sortOn ("time", Array.NUMERIC);
}
Get cue point
public void getCuePoint(nameOrTime:Object):Object {}
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (typeof (nameOrTime) == 'string') {}
If (_cuePoints [meter] .name == nameOrTime) {}
return _cuePoints [counter];
}
} Else if (typeof (nameOrTime) == 'number') {}
If (_cuePoints [meter] .time == nameOrTime) {}
return _cuePoints [counter];
}
}
counter ++;
}
Returns a null value.
}
Get the Index of the current Cue Point
private void getCurrentCuePointIndex(cuePoint:Object):Number {}
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (_cuePoints [meter] .name == cuePoint.name) {}
return the meter;
}
counter ++;
}
Returns a null value.
}
Get the next Cue Point index
private void getNextCuePointIndex(seconds:Number):Number {}
seconds (seconds) =? seconds: 0;
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (_cuePoints [meter] .time > = seconds * 1000) {}
return the meter;
}
counter ++;
}
Returns a null value.
}
Benchmark deleted
public void removeCuePoint(cuePoint:Object):Void {}
_cuePoints.splice (getCurrentCuePointIndex (cuePoint), 1);
}
Remove all Cue Points
public function removeAll_cuePoints (): Void {}
_cuePoints = new Array();
}
Beginning
public void start(secondOffset:Number,_loops:Number):Void {}
Super.Start (secondOffset, loops);
dispatchEvent ({type: "onStart", target: this});
Reset benchmark
_secondOffset = secondOffset;
_currentCuePoint = getNextCuePointIndex (secondOffset);
Poll for cue points
clearInterval (_interval);
_interval = setInterval (Delegate.create (this, pollCuePoints), _intervalDuration);
}
Load sound
public void loadSound(url:String,_isStreaming:Boolean):Void {}
super.loadSound (url, isStreaming);
clearInterval (_interval);
_interval = setInterval (Delegate.create (this, pollCuePoints), _intervalDuration);
}
Stop
public void stop(linkageID:String):Void {}
If {(linkageID)
Super.Stop (linkageID);
} else {}
Super.Stop ();
}
dispatchEvent ({type: "onStop", target: this});
Kill the ballot
clearInterval (_interval);
}
Survey benchmarks
private function pollCuePoints (): Void {}
If the current position is close to the cue point.
var time: Number = _cuePoints [_currentCuePoint] .time;
var span: Number = (_cuePoints [_currentCuePoint + 1] .time)? _cuePoints [_currentCuePoint + 1] .time: time + _intervalDuration * 2;
If (position > = time & & position < = span) {}
Send event
dispatchEvent (_cuePoints [_currentCuePoint]);
Advance to the next landmark...
If (_currentCuePoint < _cuePoints.length) {}
_currentCuePoint ++;
} else {}
_currentCuePoint = getNextCuePointIndex (_secondOffset);
}
}
}
EVENT HANDLERS
onSoundComplete
public function onSoundComplete (): Void {}
Kill the ballot
clearInterval (_interval);
Reset benchmark
_currentCuePoint = 0;
Send event
dispatchEvent ({type: "onSoundComplete", target: this});
}
}
any help will be greatly appreciated.Wuzhishan,
> Hi Dave, your tutorial is very cute and it is very useful.
Thank you! My daughter is cute. She inherited all of
me, so I have not left. ;)> I'm sorry that I don't have my question clearly.
No worries. :)
> I have listen mp3 in Windows Media Player and try to
> get both for the tail, I found it on the bottom of the
> player time indicates 00:26.I'm with you.
> How can I writer this number in the code? Is it 0026 or 26?
The code expects milliseconds, then 26 seconds would be written as
this:26000
If he said 01:22 (one minute and 22 seconds), you must write it like this:
82000
... which is 60 seconds for now, 22 seconds
side, then multiplied by 1,000 to get milliseconds.David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design." -
How to calculate the hours between two dates by the numbers
If I update 09:00 start time 17:00 end time of shift in C3 and B3, how to use a D3 formula to calculate the number of hours between the two? Then I can just copy down the lines for nth years...
It is a spreadsheet of the part-time staff payroll.
I'm sure that a lot of people out there have done that.
Help, please.
Thank you.
Eddie
What program of worksheet that you are using? Since you have a newer iMac running El Capitan, I can safely assume that you use NOT AppleWorks, which is a Power PC application that can run on any OS newer than the snow leopard, OS X 10.6.8.
If you use numbers, try to repost your question in numbers for Mac forum. If you use Microsoft Excel, try posting in the Microsoft forums. LibreOffice also has community support.
-
the data that I measured changed quickly, so I want to get the average value of the data
Don't tell me to use mean.vi, I already know.
and I got an idea that is to add data in a table every time, then the sum of all value data and take the line of result by the number of items
but I don't know how to do this, anyone can build a simple vi to show me? Thank you
I enclose my vi that uses mean.vi to the average value of calc, you can remove it and help in your path, thank you!
Do not add your data in a table that grows forever. What a waste of RAM. To calculate the average, you only need to sum and N.
Here is a simple code to accumulate the sum of the values in a shift register and divide by the number of add operations.
-
Calculate the number of fringes
Is anyone know the feasibility of the use of the Machine Vision or LabView to calculate the number of fringes in each region? (Attached image). I want to count how many white line on each region. For example, on the attached picture, there are about 6 regions and each region will display the number of the white line in their own region. For information, I have V8.5 of LabView and NI Vision Assistant V8.5. Please, give me some ideas on how to solve it.
Thank you.
Farid
Check this box
-
Calculate the hours between 2 business days
Hi all
Do a complex calculation on the days I do not know how to achieve this.
Here is my case:
I have a week of work with hours of work.
Then there's this delivery time sheet for how long should be set an order ready to be delivered:
Order1: max 5 hours of work
Order2: max 8 working hours
Order3: max 16 hours of work
When an order is placed, the time of the order is recorded, and when an order has been set in ready to be delivered, this time is also registered.
How to calculate the time difference between the time where an order has been placed and the time where the order has been on loan. Thereby also taking into account the working days and hours of work.
Example: type order1 order was placed Tuesday at 15:00.
Order has been fixed loan Wednesday at 14:00
This means that to fix this ready order lasts 7 hours, which means that it is 2 hours time.
CREATE TABLE REF_WORKDAYS ( "WERKDAG" VARCHAR2(15 ) NOT NULL ENABLE, "SOORT_WERKDAG" VARCHAR2(15 ) NOT NULL ENABLE, "BEGIN_TIJD" VARCHAR2(10 ) NOT NULL ENABLE, "EIND_TIJD" VARCHAR2(10 B) NOT NULL ENABLE, )
Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Monday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Tuesday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Wednesday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Thursday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Friday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Satrurday','WORKINGDAY','08:00','14:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Sunday','NOT-WORKINGDAY','08:00','16:00'); COMMIT;
create table glas_order (order_id number , order_desc varchar2(100) not null , order_type varchar2(10) not null , order_date date not null , order_ready date );
Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (1,'order bla','Order1',to_date('07-APR-15 09:00','DD-MON-RR HH24:MI'),to_date('08-APR-15 12:00','DD-MON-RR HH24:MI')); Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (2,'order nice','Order1',to_date('14-APR-15 10:00','DD-MON-RR HH24:MI'),to_date('16-APR-15 16:00','DD-MON-RR HH24:MI')); Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (3,'order ugly','Order2',to_date('18-APR-15 13:00','DD-MON-RR HH24:MI'),to_date('21-APR-15 09:00','DD-MON-RR HH24:MI')); COMMIT;
Thank you
Diana
Select
I like order_id
such as length d
order_type
d decode(order_type,'Order1',5,'Order2',8)
overtime
of glas_order o
model
Reference r on
(select
WERKDAG w
begin_tijd b
e eind_tijd
, (to_date (eind_tijd, 'HH24') - to_date (begin_tijd, 'HH24')) * 24 hard
of ref_workdays
where soort_werkdag = "WORKINGDAY")
dimension (w)
measures (b, e, hard)
main m
partition of (order_id I)
size of (0 n)
measures (0d, order_date, order_ready, cast (null as varchar2 (10)) as wday, order_type)
iterate (1e6) rules until (iteration_number > = trunc(order_ready[0]) - trunc(order_date[0])))
WDAY [0] = to_char (order_date [0] + iteration_number, 'FMDay', 'NLS_DATE_LANGUAGE = ENGLISH')
, d [0] = d [0] +.
case
When trunc(order_date[0]) = trunc(order_ready[0]) - beginning and ready same day
then presentv (r.b [wday [0]],)
less (largest (order_ready [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')), to_date (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))
-bigger (to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI'), least (order_date [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))))
0) * 24
When order_date [0] + iteration_number = order_date [0] - first day
then presentv (r.b [wday [0]],)
TO_DATE (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]], 'YYYYMMDDHH24:MI')
-bigger (order_date [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]],'YYYYMMDDHH24:mi'))))
0) * 24
When trunc(order_date[0]) + iteration_number = trunc(order_ready[0]) - last day
then presentv (r.b [wday [0]],)
less (order_ready [0], to_date (to_char (order_ready [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))
-to_date (to_char (order_ready [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')
0) * 24
of another nvl (r.dur [wday [0]], 0)
end
)
ORDER_ID DURATION ORDER_TYPE OVERTIME 1 11 Order1 6 2 22 Order1 17 3 10 Order2 2 Rewrittten party rules for readability purposes (more resources)
measures (0d, order_date, order_ready, cast (null as varchar2 (10)) as to_date (null), (null) to_date, bd, order_type, wday ed)
iterate (1e6) rules until (iteration_number > = trunc(order_ready[0]) - trunc(order_date[0])))
WDAY [0] = to_char (order_date [0] + iteration_number, 'FMDay', 'NLS_DATE_LANGUAGE = ENGLISH')
, comics [0] = to_date (to_char (order_date [0] + iteration_number, 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')
, ed [0] = to_date (to_char (order_date [0] + iteration_number, 'YYYYMMDD') | r.e [WDAY [0]], 'YYYYMMDDHH24:MI')
, d [0] = d [0] +.
case
When trunc(order_date[0]) = trunc(order_ready[0]) - beginning and ready same day
then presentv (r.b [wday [0]],)
less (largest (order_ready [0], [0] bd), ed [0])
-Greatest (BD [0], least(ORDER_DATE[0],ED[0]))
0) * 24
When order_date [0] + iteration_number = order_date [0] - first day
then presentv (r.b [wday [0]],)
ED [0]
-Greatest(ORDER_DATE[0],BD[0])
0) * 24
When trunc(order_date[0]) + iteration_number = trunc(order_ready[0]) - last day
then presentv (r.b [wday [0]],)
least(order_ready[0],ED[0])
-bd [0]
0) * 24
of another nvl (r.dur [wday [0]], 0)
end
)
Jubilee should be Saturday I guessed.
-
Calculate the values in the table
I have a table with several lines. have 2 input text in each row of the table. In the same vein, there is a field (outputText) whose calculation is based on the insertion of data from the other two.
the calculation is performed correctly.
the problem occurs when I have more q a row in the table. If you have 3 lines, for example, are calculated for a line (not being not not the first) to the other lines that this field is null / empty.
I think that it does not have the iterator. Anyone help me?
Hi user,
Calculate the difference using the class viewrow for more information
Look at the blog below could help ful
Andrejus Baranovskis Blog: Column calculated in ADF Faces component af:table
Maybe you are looking for
-
Disable WiFi on TC and used as a backup only
I have a Time Capsule that I want to disable the functionality of WiFi Access Point and JUST keep the Capsule as the backup drive. I bought a new router that is not Apple Time Capsule, and I really don't want to have WiFi on the TC, and I want to be
-
Very easy to send a picture by clicking right on it and then selecting "send Image". Why is there not a corresponding 'Email Link' (i.e. send link) when the mouse cursor is over a hyperlink? The only way to do this now is to actually open the new pag
-
When I search a Word using the search bar, Firefox highlights all the hits on the page. (Sometimes it highlights some.) Apparently, he sees shots, because it climbs to everyone that I click Next. But it is not to highlight the successes. I don't see
-
Pavilion Media Edition a1640n - adding hard drives
I want to add a second hard drive of my Media Edition Pavilion a1640n. I found the SATA ports, but I can't find a free plug in power cable. The existing HD has 2 caps of small power inside. 1 is just a 2 orange wires. Any help?
-
Windows experience Index Crash
I can't record my system because whenever I start my pc Windows experience index rate, the pc just shuts.I run a CPU from 3.4 Ghz 64-bit 2 GB of RAM on a GeForce 7800GTX 256 MB RAM I was able to retrieve this message from the journal of the C:\Window