my first time here.
I have a lease table where each row has the follow:
Lease number | Tenant name | unit number | checkin date | checkout date.
I need to have a table (prefer a PIVOT) that will show me the total occupation (by %) per month for each year. Keep in mind that the checkin-checkout dates can be from mid of one month till mid of another month (oct 3 2020 - feb 17 2021)
Expected result:
| 2019 | 2020 | 2021
jan | 0% | 58% | 67%
feb | 67% | 21% | 42%
mar ....
as I'm not a professional sim looking for a simple/easy way to resolve it.
I have the below file.rpt:
Data Manhattan Wire Wire
Delay Distance Length Diff[%]
#############################
0.558 728.282 738.89 1%
0.481 255.258 285.887 12%
0.552 652.888 677.985 4%
0.431 420.896 477.73 14%
0.506 580.288 633.018 9%
0.388 350.22 463.05 32%
0.541 622.088 672.761 8%
0.462 384.064 586.98 53%
0.565 574.016 594.434 4%
0.470 339.268 450.927 33%
0.566 664.304 672.092 1%
0.441 436.428 534.146 22%
I'm trying to sort one of the column and keep the 3 lines header without any change.
How can I do it without manipulate to other file?
I tried something similar to the below:
head -3 file.rpt ; sort -nrk4,4 file.rpt | -
I suppose this doesn't really count as a csh answer, but:
sh -c '{ sed 3q file.rpt; sed 1,3d file.rpt | sort -nrk4,4; }'
In csh, you can do:
( sed 3q file.rpt; sed 1,3d file.rpt | sort -nrk4,4; )
You can do this:
head -3 file.rpt ; tail -n +4 file.rpt | sort -nrk4,4
-n: output the last X lines
+4: output starting with line 4. Hence skip the first 3 lines
use | to send the output of tail as the input to sort.
Result:
Data Manhattan Wire Wire
Delay Distance Length Diff[%]
#############################
0.462 384.064 586.98 53%
0.470 339.268 450.927 33%
0.388 350.22 463.05 32%
0.441 436.428 534.146 22%
0.431 420.896 477.73 14%
0.481 255.258 285.887 12%
0.506 580.288 633.018 9%
0.541 622.088 672.761 8%
0.565 574.016 594.434 4%
0.552 652.888 677.985 4%
0.566 664.304 672.092 1%
0.558 728.282 738.89 1%
How do I find the total working hours of the below driver?
Duty code Dep.Time Arri.Time
A001 03:35 04:20
A001 04:35 05:20
A001 05:51 06:20
A001 06:40 07:20
A001 09:40 10:20
Total Working Hour: 10:20-03:35 = 06:45hrs
Is there a formula to find the total working hours of a single person or a single duty card?
If you only have one Duty Code as in the example, you can use the MAX and MIN functions to calculate the total hours.
If you have more than one Duty Code, you can use MAXIFS and MINIFS.
Can anyone help me with this little problem. I will try and explain as bets i can!!
We have a P6 schedule exported into Excel (Dont ask why we dont just do this in P6) and a some estimates. We have a start and finish date for each activity from the schedule dump and the cost of each activity from the estimte. What we would like to be able to do is be able to spread these costs in a cost loaded curve. Simple enough if every activity will have the same cost profile. But they dont and here is the tricky bit. We would like to be able to select the profile 6 in all and then excel would do its magic and proportion the cost between the 2 dates according to the cost profile selected... Simples, I hope!!
Curve Profiles
1 10% 10% 10% 10% 10% 10% 10% 10% 10% 10% 100%
2 1% 2% 3% 7% 13% 17% 20% 19% 13% 5% 100%
3 5% 13% 19% 20% 17% 13% 7% 3% 2% 1% 100%
4 3% 7% 11% 14% 15% 15% 14% 11% 7% 3% 100%
5 100% 0% 0% 0% 0% 0% 0% 0% 0% 0% 100%
6 0% 0% 0% 0% 0% 0% 0% 0% 0% 100% 100%
P6 is Primavera is a planning tool. We are going to use polynomial formula to determine what the split is along the line for the total value. =3.10862446895044E-15*C16^6 + 0.0000128205126657122*C16^5 - 0.000384615378834496*C16^4 + 0.00211538450821536*C16^3 + 0.0173076931969263*C16^2 - 0.0324778592548682*C16 + 0.0136363733254257 We are struggling to work out how to get excel to determine the date set automatically. Below is a cut of the data.
Activity ID Activity Name Duration Start Finish Total Month Total Float Budgeted Total Cost
A1740 Major Permissions - Project Management 734 01-Apr-17 22-Feb-19 23 1939 £6,748,243
A1630 MPP2 - Main Site DCO Contracts 742 01-Apr-17 06-Mar-19 24 1931 £6,027,265
A1650 MPP3 - SP&C Contracts 553 01-Apr-17 08-Jun-18 15 2120 £299,795
A1660 MPP4 - Highways Contracts 443 01-Apr-17 29-Dec-17 9 2230 £881,005
A1670 MPP5 - Worker's Accomodation Contracts 445 01-Apr-17 03-Jan-18 10 2228 £920,193
A1690 MPP6 - Logistics, Park & Ride Contracts 746 01-Apr-17 12-Mar-19 24 1927 £581,667
A1720 MPP7 - Marine Licences Contracts 709 01-Apr-17 18-Jan-19 22 1964 £1,879,577
A1730 MPP8 - Environmental Permits Contracts 546 01-Apr-17 30-May-18 14 2127 £1,291,958
We did it!! Dont ask me how but someone with a much bigger brain then me worked out the formula. If anyone wants it just ask and i can send it over without the data just the formula. Here is a taster!!
Used for working out the time scale.
=IF(MONTH($D8)&YEAR($D8)=MONTH(I$2)&YEAR(I$2),(1-((DAY($D8)-1)/HLOOKUP(MONTH($D8),Monthdays,'Base Data'!$A$4,FALSE))),IF(MONTH($E8)&YEAR($E8)=MONTH(I$2)&YEAR(I$2),(DAY($E8))/HLOOKUP(MONTH($E8),Monthdays,'Base Data'!$A$4,FALSE)+H8,IF(OR(MONTH($E8)&YEAR($E8)=(MONTH(I$2)-1)&YEAR(I$2),MONTH($E8)&YEAR($E8)=12&YEAR(I$2)-1),0,IF(H8-G8>0,H8+1,H8))))
For the cost.
=IF(OR('Cumulative Cash Flow'!$G176="Linear",'Cumulative Cash Flow'!$G176="Project-S; Early",'Cumulative Cash Flow'!$G176="Project-S",'Cumulative Cash Flow'!$G176="Project-S; Late"),((VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,2,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^6+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,3,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^5+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,4,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^4+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,5,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^3+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,6,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^2+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,7,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176))
+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,8,FALSE)*('Time-Phase'!I176/'Cumulative Cash Flow'!$H176))*'Cumulative Cash Flow'!$F176,IF(AND('Cumulative Cash Flow'!$G176="Upfront Payment",'Time-Phase'!I176>0,'Time-Phase'!I176<=1),'Cumulative Cash Flow'!$F176*VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,8,FALSE),IF(AND('Cumulative Cash Flow'!$G176="Final Payment",'Time-Phase'!I176='Cumulative Cash Flow'!$H176),'Cumulative Cash Flow'!$F176*VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,8,FALSE),0)))
I'm looking for a command where only the highest disk space usage mount will be shown. So The maximum %usage mount will be shown.
Running df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vx/dsk/appdg/boom-vol
1.0G 19M 943M 2% /opt/blah99
500G 349G 152G 70% /opt/blah/data
/dev/vx/dsk/isdg/boom-shared-vol
50G 1.6G 46G 4% /opt/blah99/product/shared
/dev/vx/dsk/isdg/boom-bc-vol
150G 64G 81G 45% /opt/blah99/product/a_01
/dev/vx/dsk/isdg/boom-bt-vol
150G 47G 98G 33% /opt/blah99/product/a_02
Output should be -
500G 349G 152G 70% /opt/blah/data
What you are looking for is:
df -h | grep -vw "^\/dev" | sort -k 5 -n | tail -n 2 | head -n 1
Output of df -h | grep -vw "^\/dev":
Filesystem Size Used Avail Use% Mounted on
1.0G 19M 943M 2% /opt/blah99
500G 349G 152G 70% /opt/blah/data
50G 1.6G 46G 4% /opt/blah99/product/shared
150G 64G 81G 45% /opt/blah99/product/a_01
150G 47G 98G 33% /opt/blah99/product/a_02
Sorting by column 5 in numeric order: df -h | grep -vw "^\/dev" | sort -k 5 -n:
50G 1.6G 46G 4% /opt/blah99/product/shared
1.0G 19M 943M 2% /opt/blah99
150G 47G 98G 33% /opt/blah99/product/a_02
150G 64G 81G 45% /opt/blah99/product/a_01
500G 349G 152G 70% /opt/blah/data
Filesystem Size Used Avail Use% Mounted on
Getting second row from the end: df -h | grep -vw "^\/dev" | sort -k 5 -n | tail -n 2 | head -n 1:
500G 349G 152G 70% /opt/blah/data