My friend and I have the same type of internet connection (ADSL 2+) and we get similar speeds (10 down 1 up) and ping, but when we both try to connect to the same IP we get different pings. We are trying to connect to a server in canada (158.69.135.112) from australia and I get a much higher ping, though if we both ping an IP in the US or UK we get a very similar ping. Here are our traceroute results.
My Traceroute
C:\Users\Baiden>tracert 158.69.135.112
Tracing route to 158.69.135.112 over a maximum of 30 hops
1 3 ms <1 ms <1 ms dsldevice.gateway [10.0.0.138]
2 22 ms 22 ms 26 ms 172.18.208.11
3 21 ms 23 ms 22 ms 172.18.92.1
4 23 ms 22 ms 23 ms bundle-ether4.ken-edge902.sydney.telstra.net [203.50.12.106]
5 24 ms 23 ms 23 ms bundle-ether14.ken-core10.sydney.telstra.net [203.50.11.96]
6 28 ms 58 ms 30 ms bundle-ether1.pad-gw11.sydney.telstra.net [203.50.6.61]
7 24 ms 27 ms 26 ms bundle-ether1.sydp-core04.sydney.reach.com [203.50.13.90]
8 166 ms 166 ms 166 ms i-0-1-0-5.paix-core01.bx.telstraglobal.net [202.84.140.58]
9 166 ms 165 ms 164 ms i-0-5-0-1.paix02.bi.telstraglobal.net [202.40.149.110]
10 168 ms 158 ms 179 ms xe-5-3-0.paloalto2.pao.seabone.net [195.22.206.129]
11 262 ms 252 ms 254 ms et-4-3-0.miami15.mia.seabone.net [195.22.199.177]
12 333 ms 254 ms 245 ms et-10-1-0.miami15.mia.seabone.net [89.221.41.175]
13 * 430 ms * po99-155.mia-5-6k.fl.us [178.32.135.208]
14 476 ms 457 ms * be100-1035.nwk-1-a9.nj.us [198.27.73.197]
15 430 ms 429 ms 434 ms be10-1037.bhs-g1-a9.qc.ca [192.99.146.99]
16 437 ms 439 ms 441 ms bhs-3a-a9.qc.ca [198.27.73.92]
17 441 ms 428 ms 427 ms 158.69.135.112
Trace complete.
Friend's Traceroute
Tracing route to 158.69.135.112 over a maximum of 30 hops
1 <1 ms <1 ms <1 ms m.home [10.0.0.138]
2 89 ms 39 ms 40 ms 172.18.210.19
3 64 ms 69 ms 66 ms 172.18.68.157
4 45 ms 45 ms 39 ms bundle-ether4.lon-edge902.melbourne.telstra.net [203.50.76.12]
5 64 ms 47 ms 39 ms bundle-ether11.exi-core10.melbourne.telstra.net [203.50.11.113]
6 57 ms 59 ms 60 ms bundle-ether12.chw-core10.sydney.telstra.net [203.50.11.124]
7 66 ms 66 ms 68 ms bundle-ether1.oxf-gw11.sydney.telstra.net [203.50.6.93]
8 62 ms 181 ms 57 ms bundle-ether1.sydo-core03.sydney.reach.com [203.50.13.98]
9 61 ms 65 ms 62 ms i-0-1-0-16.sydo-core04.bi.telstraglobal.net [202.84.222.58]
10 195 ms 210 ms 239 ms i-0-2-0-0.1wlt-core01.bx.telstraglobal.net [202.84.141.146]
11 355 ms 228 ms 231 ms i-0-5-0-5.eqla01.bi.telstraglobal.net [202.84.253.30]
12 233 ms 218 ms 208 ms unknown.telstraglobal.net [134.159.63.171]
13 * 274 ms 257 ms if-6-20.tcore2.LVW-Los-Angeles.as6453.net [64.86.252.65]
14 301 ms 272 ms 288 ms if-2-2.tcore1.LVW-Los-Angeles.as6453.net [66.110.59.1]
15 280 ms 278 ms 305 ms if-8-2.tcore2.DT8-Dallas.as6453.net [66.110.57.81]
16 266 ms 260 ms 263 ms if-2-2.tcore1.DT8-Dallas.as6453.net [66.110.56.5]
17 295 ms 335 ms 261 ms if-23-2.tcore2.CT8-Chicago.as6453.net [64.86.79.120]
18 268 ms 269 ms 279 ms if-22-2.tcore1.CT8-Chicago.as6453.net [64.86.79.2]
19 295 ms 299 ms 290 ms be100-152.chi-5-a9.il.us [198.27.73.69]
20 338 ms 349 ms 317 ms be10-1218.bhs-g2-a9.qc.ca [198.27.73.89]
21 327 ms 315 ms 331 ms bhs-3a-a9.qc.ca [198.27.73.94]
22 301 ms 313 ms 315 ms 158.69.135.112
Trace complete.
My friend ends up with over 100ms ping less than me, is there a problem with the traceroute? I notice between hops 12 and 13 on the first traceroute there is a big jump, could this be an issue? Any help is appreciated!
Your friend has a better route than yours. He pass through Chigago and you by Miami. Maybe Miami is experiencing some link saturation or even a route flapping. I'm OVH customer too and I have no problem in the routes through Miami (maybe cause I'm reaching by another OVH router port). As you live in Australia, I recommend you to host in OVH UK or FR.
C:\Users\Victor>tracert 158.69.135.112
Rastreando a rota para 158.69.135.112 com no máximo 30 saltos
1 1 ms <1 ms <1 ms 192.168.1.1
2 1 ms 1 ms <1 ms 192.168.168.1
3 4 ms 2 ms 2 ms 186-225-128-155.oquei.com.br [186.225.128.155]
4 5 ms 3 ms 24 ms 186-225-128-1.oquei.com.br [186.225.128.1]
5 3 ms 3 ms 2 ms 186-225-147-89.customer.sinalbr.com.br [186.225.147.89]
6 4 ms 3 ms 3 ms xe-0-0-1-411.edge-a.srr001.algartelecom.com.br [187.72.97.206]
7 14 ms 13 ms 14 ms et-8-0-3-0.ptx-a.rpo008.algartelecom.com.br [201.48.48.157]
8 16 ms 16 ms 16 ms et-14-0-0-0.ptx-a.cas512.algartelecom.com.br [201.48.45.90]
9 19 ms 16 ms 18 ms et-8-0-1-0.ptx-a.spo-piaf.algartelecom.com.br [201.48.48.254]
10 118 ms 133 ms 119 ms ae0-0.border-b.mia.algartelecom.com.br [201.48.45.166]
11 143 ms * 118 ms 198.32.125.64
12 151 ms 148 ms 151 ms be100-1036.nwk-1-a9.nj.us [198.27.73.199]
13 156 ms 160 ms 160 ms be10-1037.bhs-g1-a9.qc.ca [192.99.146.99]
14 160 ms 158 ms 158 ms bhs-3a-a9.qc.ca [198.27.73.92]
15 156 ms 157 ms 155 ms 158.69.135.112
Rastreamento concluído.
Related
I have a text file with uneven blank spaces and I want to store it as a csv file using pig.My file is of the format
2013 210 0 2878 -7543 4 29 20 116
2013 210 10 2875 -7538 4 32 20 116
2013 210 20 2872 -7533 4 29 20 116
2013 210 30 2870 -7527 4 29 20 115
2013 210 40 2867 -7522 4 30 20 115
2013 210 50 2864 -7516 4 29 20 115
2013 210 60 2861 -7511 4 29 20 115
If you are having uneven spaces, read the values as a single line first then squeeze the data with a regular expression then use STRSPLIT to split the single space separated data.
text_data = load 'file.txt' as line;
squeezed_data = foreach text_data generate REPLACE(line, '\\s+', ' ');
I am trying to figure out how to select the 1st property ID per client ID that gets associated to the Customer ID. Please help. How would I query this?
PropertyID ClientID CustomerID Date
10 1 35 2004
20 1 35 2004
30 2 35 2004
40 2 35 2004
50 3 35 2004
60 3 35 2004
70 4 35 2004
80 4 35 2004
90 5 35 2004
100 5 35 2004
110 6 35 2005
120 6 35 2005
130 7 35 2005
140 7 35 2005
150 8 35 2005
160 8 35 2005
170 9 35 2005
180 9 35 2005
220 15 37 2007
240 15 37 2007
260 16 37 2007
270 16 37 2007
Expected Result:
PropertyID ClientID CustomerID
10 1 35
30 2 35
50 3 35
70 4 35
90 5 35
110 6 35
130 7 35
150 8 35
170 9 35
220 15 37
260 16 37
Assuming by 1st you mean with lowest propertyId, you can use aggregation in subquery to find the lowest propertyId per clientId and then join the results with the original table to get the other corresponding columns.
select propertyId, clientId, customerId
from your_table t
join (
select clientId,
min(propertyId) as propertyId
from your_table
group by clientId
) t2 using (clientId, propertyId);
This assumes the propertyId is unique (per client at least).
Demo
SELECT MIN(PropertyID) AS PropertyID, ClientID, CustomerID
FROM table_name
GROUP BY ClientID,CustomerID;
http://sqlfiddle.com/#!9/e3dce/1
for example
purchase_request_master
prm_voucher_no| project_id| status_id| request_date
17 46 3 11-6-2016 0:00
18 46 3 20-6-2016 0:00
19 46 3 216-2016 0:00
purchase_request_details
prm_voucher_no| item_id| request_quantity
17 80 50
17 81 100
18 80 75
19 83 10
19 81 35
19 82 120
purchase_order_master
pom_voucher_no| prm_request_id |supplier_id
16 17 14
17 18 14
18 19 15
purchase_order_details
pom_voucher_no| approved_quantity| rate
16 50 1000
16 100 1500
17 75 150
18 10 2500
18 35 3000
18 120 1700
when I run the below query it gives 14 rows(duplicate row returning).expected out put row is 6.. Please refer below output tables..
select prm.prm_voucher_no,prm.project_id,prm.status_id,prd.requested_quantity,prd.item_id,pom.pom_voucher_no,pom.supplier_id,pod.rate,pod.approved_quantity
from purchase_request_master prm
left join purchase_request_details prd on prd.prm_voucher_no=prm.prm_voucher_no
left join purchase_order_master pom on prm.prm_voucher_no=pom.request_id
left join purchase_order_details pod on pom.pom_voucher_no=pod.pom_voucher_no
where prm.project_id=46 and ( EXTRACT(MONTH FROM prm.request_Date)=6) and (EXTRACT(YEAR FROM prm.request_Date)=2016)
group by prm.voucher_no,prm.project_id,prm.status_id,prd.requested_quantity,prd.item_id,pom.voucher_no,pom.supplier_id,pod.rate,pod.approved_quantity
order by prm.voucher_no
i tried inner join,distinct,distinct least,group by,temporary table,with clause all these method.. but no use every this gives duplicate row
How to solve this problem..
OUTPUT
prm_voucher_no| project_id| status_id|item_id|request_quantity |pom_voucher_no| supplier_id|approved_quantity | rate
17 46 3 80 50 16 14 100 1000
17 46 3 81 100 16 14 75 1500
17 46 3 80 75 16 15 10 150
17 46 3 81 10 16 14 35 10
18 46 3 81 35 17 14 120 35
19 46 3 80 120 18 15 50 120
19 46 3 81 50 18 14 100 1000
19 46 3 82 100 18 14 75 1500
19 46 3 80 75 18 15 10 150
19 46 3 81 10 18 14 35 10
19 46 3 82 35 18 14 120 35
19 46 3 80 120 18 15 35 120
19 46 3 81 35 18 14 50 1500
19 46 3 82 50 18 15 100 1700
EXPECTED OUTPUT
prm_voucher_no| project_id| status_id| item_id| request_quantity| pom_voucher_no| supplier_id|approved_quantity| rate
17 46 3 80 50 16 14 100 1000
17 46 3 81 100 16 14 75 1500
18 46 3 81 35 17 14 120 35
19 46 3 80 120 18 15 50 120
19 46 3 81 50 18 14 100 1000
19 46 3 82 100 18 14 75 1500
I think the problem is in your data model itself. Ideally, you would have a line_number field in both of your "detail" tables, and this would be used in the join:
create table purchase_request_details (
prm_voucher_no integer,
prm_voucher_line integer, // Add this
item_id integer,
request_quantity
)
create table purchase_order_details (
pom_voucher_no integer,
pom_voucher_line integer, // and this
approved_quantity integer,
rate integer
)
And then this query would give you the results you seek:
select
prm.prm_voucher_no,prm.project_id,prm.status_id,prd.request_quantity,
prd.item_id,pom.pom_voucher_no,pom.supplier_id,pod.rate,pod.approved_quantity
from
purchase_request_master prm
left join purchase_request_details prd on
prd.prm_voucher_no=prm.prm_voucher_no
left join purchase_order_master pom on
prm.prm_voucher_no=pom.prm_request_id
left join purchase_order_details pod on
pom.pom_voucher_no=pod.pom_voucher_no and
prd.prm_voucher_line = pod.pom_voucher_line // This is the key
where
prm.project_id=46 and
EXTRACT(MONTH FROM prm.request_Date) = 6 and
EXTRACT(YEAR FROM prm.request_Date) = 2016
order by prm.prm_voucher_no
If you have no ability to control the data model, then I think the best you can do is artificially add a line number. I don't recommend this at all, as you are presupposing a lot of things, most notably that the order of records in the one table automatically correlates to the order of records in the other -- and I'm betting that's far from a guarantee.
Adding a line number would be done using the row_number() analytic, and PostgreSQL has that but MySQL does not... you have both tags in your question. Which DBMS are you using?
If you can't add line numbers, can you add item_id to your purchase_order_details table? This would likely handle your issue, unless you can have the same item on multiple lines within a purchase request/order.
In the data you have above, a join on the requested quantity (prd.request_quantity = pod.approved_quantity) fixes your issue, but I am highly confident that this would burn you when you started running it against real data.
I have a matrix with rows grouped by Dept (Department). I am trying to get the actual hours / required hours percentage in a column for each row group, but I can only get the total %, not the % by group. Ex:
I should get this:
Total Employee Req Hrs Rep Hrs % Billable hrs % NonBill Hrs % Time Off %
Dept A Total 672 680 101 575 85 140 21 8 1
Emp1 168 170 101 150 89 50 29 0 0
Emp2 168 165 98 120 71 20 12 8 4
Emp3 168 175 104 155 92 20 12 0 0
Emp4 168 170 101 150 89 50 29 0 0
Dept B Total 420 428 102 365 87 80 19 4 .1
Emp5 168 170 101 150 89 50 29 0 0
Emp6 84 84 98 60 71 10 12 4 4
Emp7 168 175 104 155 92 20 12 0 0
G Total 1092 1108 101 940 86 190 17 12 1
But I get this:
Total Employee Req Hrs Rep Hrs % Billable hrs % NonBill Hrs % Time Off %
Dept A Total 1684 1675 101 1250 86 225 17 12 1
Emp1 168 170 101 150 89 50 29 0 0
Emp2 168 165 98 120 71 20 12 8 4
Emp3 168 175 104 155 92 20 12 0 0
Emp4 168 170 101 150 89 50 29 0 0
Dept B Total 1092 1108 101 1250 86 225 17 12 1
Emp5 168 170 101 150 89 50 29 0 0
Emp6 84 84 98 60 71 10 12 4 4
Emp7 168 175 104 155 92 20 12 0 0
G Total 1092 1108 101 940 86 190 17 12 1
The totals are correct but the % is wrong.
I have several Datasets because the report only runs the department you are in, except for the VPs who can see all departments.
I Insert the percentage columns into the matrix and have tried several expressions with no results including:
=Fields!ActHrs.Value/Fields!ReqHrs.Value
=Sum(Fields!ActHrs.Value, "Ut_Query")/Sum(Fields!ReqHrs.Value, "Ut_Query")
=Sum(Fields!ActHrs.Value, "Ut_Query","Dept")/Sum(Fields!ReqHrs.Value,
"Ut_Query","Dept")
=Sum(Fields!ActHrs.Value,"Dept", "Ut_Query")/Sum(Fields!ReqHrs.Value,
"Dept","Ut_Query")
Plus more I can't even remember.
I tried creating new groups, and even a new matrix.
There must be a simple way to get the percentage by group but I have not found an answer on any of the interned boards.
OK, I figured this out, but it doesn't make much sense. If I try:
=Textbox29/TextBox28 I get error messages about undefined variables.
If I go the the textbox properties and rename the textboxes to Act and Req and use:
=Act/Req I get the right answer.
Please i need help to calculate moving average in SSRS. see example from excel bellow. i have search net and looked at other forum without success.
the moving average is something like Avg(A1:A3),Avg(A2:A4),Avg(A3:A5)etc
Count of ID BAND
-20 >20 <12 Grand Total Three Months Avg
Year Month <15 15-20 >20 Total
2012/2013 Jan 35 9 13 57 57
Feb 34 23 20 77 67
Mar 25 33 8 66 =AVERAGE(F5:F7)
Apr 7 31 13 51 65
May 6 10 13 29 49
Jun 19 14 18 51 44
Jul 34 16 6 56 45
Aug 26 21 30 77 =AVERAGE(F10:F12)
Sep 13 53 21 =AVERAGE(F11:F13)
Oct 1 34 33 68 =AVERAGE(F12:F14)
Nov 35 16 19 70 53
Dec 33 23 36 92 77