POST
|
Yes, I'm using pandas .read_excel and .to_csv I was out Friday and will come back to this later today, but plan to look further at what Matt Kramer posted above. Thanks
... View more
05-03-2021
08:25 AM
|
0
|
0
|
5663
|
POST
|
I have a .csv that was created using input_xls.to_csv, and everything delimits correctly. However, within some of the string records are commas (e.g. a business name like 'Widgets, Inc.'). The result is incorrect delimiting when importing the .csv into a file geodatabase using arcpy.conversion.TableToTable - values end up shifted over into other columns. I want to replace the commas with a space. I cannot figure out how to use either something like .apply(lambda x: x.replace(',', ' ')) or [val if val else " " for val in row] + ([" "] * (len(first_row) - len(row))) (found here: https://community.esri.com/t5/python-questions/find-and-replace-blanks-in-csv-with-python/m-p/673632) Any help to nudge me in the right direction would be appreciated. Thanks.
... View more
04-29-2021
12:11 PM
|
0
|
8
|
5716
|
POST
|
Thanks Kara. We're actually redesigning this project now. I'm not sure if your suggestion would account for leap year days, etc. Regardless, we're moving on for now but thanks again.
... View more
03-25-2021
01:35 PM
|
0
|
0
|
1447
|
POST
|
We are attempting to maintain a dataset to include records only for the past 3 years. New records are appended daily (via other scripted geoprocessing). The table is in Enterprise SQL, and contains both varchar date (dd/mm/yyyy) and datetime (yyyy-mm-dd hh:mm:ss:ms) fields. How do I select records that are 3 years older than yesterday (for deletion)? I thought I was going down the correct path with this in SQL but I'm not getting far: DateTimeField < DATEADD(yy, -3, CONVERT(datetime, CONVERT(varchar, GETDATE(), 101))) I need selections to the day, not the datetime (e.g. On March 11, the new records from March 10 are appended, and anything more than 3 years older than March 10 are deleted. It's to the full date, not the actual time of day when the script is run.) This selection will be used within a scheduled .py daily. Thanks Justin
... View more
03-11-2021
12:33 PM
|
0
|
2
|
1551
|
IDEA
|
I work with @Anonymous User and this would be a nice capability when data sources are unstable or incorrect and simply "hiding" a Dashboard element (or group of elements) would be preferable to displaying incorrect or no data at all. (e.g. a nightly SQL stored procedure fails and the resulting data feeding a dashboard element are incorrect). Currently the only way to hide/obscure an element is to delete it entirely, requiring it to be completely recreated and reconfigured later. Using Experience builder, a workaround would be to make a copy of the Dashboard, delete the elements to be hidden, then temporarily place the copy of the Dashboard in Experience builder, but this can quickly become messy. Thanks
... View more
01-06-2021
02:56 PM
|
0
|
0
|
1452
|
POST
|
Version: ArcGIS Pro 2.6.3 Data: Enterprise SQL 2016 I have a table of parcel sales data, with ParcelID field (text type) as the parcel identifier and SaleDate (date type). There are multiple rows for the same ParcelID value, each with a different SaleDate value. I want a selectio of the records keeping only the latest date, within model builder (it's part of a larger process). Based on the guidance here: https://support.esri.com/en/technical-article/000008936 I have the following in a Select Layer By Attribute or Table Select tool - both have the same results: SaleDate IN (SELECT MAX(SaleDate) FROM countySL GROUP BY ParcelID) I cannot get this to return the correct values. I run this in SSMS and get exactly what I'd expect: SELECT n.* FROM [dbo].[COUNTYSL] n INNER JOIN ( SELECT ParcelID, MAX(SaleDate) AS SaleDate FROM [dbo].[COUNTYSL] GROUP BY ParcelID ) AS MAX ON MAX.ParcelID = n.ParcelID AND MAX.SaleDate = n.SaleDate ORDER BY ParcelID; GO I had originally built everything around FGDB, but moved to Enterprise SQL to use GROUP BY functionality. Is there something special with the date format? In SSMS, this is what the countySL data looks like: Source countySL table And if I run the query below I get what I need: functional query in SSMS But in ArcGIS Pro model builder, if I use the query below: SQL in Model Builder I get this: Table Select results I've attempted using the Select Layer By Attribute tool as well, and messed with the 'Invert Where Clause' and attempted to switch selection from the source table, but it doesn't work either. What am I missing? Thanks
... View more
12-09-2020
12:51 PM
|
2
|
1
|
2824
|
POST
|
I know this post is old, but I'm struggling to do what is simply the GROUP BY function in SQL. I have a table (in a file geodatabase) of land parcels with sale dates - multiple rows in the table have the same parcel number but different sale dates - I need a query for records with the latest/most recent sale date). For various reasons I need to use File Geodatabase. Can Model Builder in Pro 2.6.3 handle this without the need for additional tables, etc.? Thanks
... View more
12-07-2020
12:18 PM
|
0
|
0
|
3670
|
POST
|
Josh - you're absolutely right, I was overthinking. Thanks. This is in a model anyway, so just selecting records that are not '0' or null, calculating and moving on is simple. I was attempting to use code block but not having any luck (see below) but it's no big deal because I'll just use a selection: def X(LastUpdateDate):
if X is None:
return '99/99/9999'
elif X == '0':
return '99/99/9999'
else X == "{}/{}/{}".format(!LastUpdateDate![4:6], !LastUpdateDate![6:], !LastUpdateDate![:4]):
return X
... View more
10-14-2020
08:13 AM
|
0
|
0
|
1655
|
POST
|
Thank you Joshua, that works. Now I need to work on error-handling, as my data has a lot of null and '0' values that I need to have come through as null. Thanks again for the Python
... View more
10-14-2020
05:16 AM
|
0
|
2
|
1655
|
POST
|
I have a text field with date values in YYYYMMDD format. I need to get them into the MM/DD/YYYY format in a text field (the target field for the MM/DD/YYYY values is text, not date). The source field containing the YYYYMMDD values is named 'LastUpdateDate' and the target for the MM/DD/YYYY values is named 'CAMAUpdate'. I'm attempting to use this: SUBSTRING(!LastUpdateDate!,4,5)+'/'+SUBSTRING(!LastUpdateDate!,6,7)+'/'+SUBSTRING(!LastUpdateDate!,0,3) In Pro 2.6.2 it fails with: ERROR 000539: Traceback (most recent call last): File "<expression>", line 1, in <module> NameError: name 'SUBSTRING' is not defined Source data is a polygon feature class in a file geodatabase.
... View more
10-13-2020
01:06 PM
|
0
|
4
|
1741
|
POST
|
Hi Derek, thank you for the reply. Nebraska Department of Health and Human Services (DHHS) Twitter handle is @NEDHHS
... View more
06-02-2020
08:23 AM
|
1
|
0
|
1004
|
POST
|
We stood up a Dashboard reporting COVID-19 data a few months ago and are regularly being asked to apply significant changes, which require republishing services and updating the map utilized by the Dashboard. This ultimately requires significant time to rebuild the Dashboard to look at the new, updated source web map. We can't simply clone a new dashboard from Portal into AGO, because we must retain the existing Dashboard URL. Is there a way to utilize the ArcGIS Online Assistant to "replace" the .json of the AGO Dashboard with that from an updated Portal Dashboard? So far my attempts at altering the .json have not worked. Thanks (we're running Portal 10.7) Our current COVID-19 Dashboard in AGO: ArcGIS Dashboards
... View more
06-02-2020
05:01 AM
|
0
|
2
|
1073
|
POST
|
Josh, I've since modified my data so the AddrPrimaryHighNo field is now a string, but for the following (when AddrPrimaryHighNo was a double): AddrPrimaryHighNo StreetPreDrctnAbbrev StreetName StreetSuffixAbbrev StreetPostDrctnAbbrev 1699 <Null> 220TH ST <Null> When I use: str(!AddrPrimaryHighNo!) + " " + str(!StreetPreDrctnAbbrev!) + " " + str(!StreetName!) + " " + str(!StreetSuffixAbbrev!) + " " + str(!StreetPostDrctnAbbrev!) I receive: 1699.0 None 220TH ST None So I may have not typed out the correct outcome in my original message, sorry about that. Thank you all for your quick replies and helpful information. A coworker also pointed out there is a Concatenate Fields under Helpers in the Calculate Field geoprocessing window, which sets up a code block with a def, etc. -Justin
... View more
09-05-2019
06:49 AM
|
0
|
0
|
4488
|
POST
|
I'm attempting to concatenate several fields, where one of the source fields is a double, the rest are string, and all of them have some <Null> values. If I use the following syntax in Calculate Field in Pro 24.1/Python 3: str(!AddrPrimaryHighNo!) + " " + str(!StreetPreDrctnAbbrev!) + " " + str(!StreetName!) + " " + str(!StreetSuffixAbbrev!) + " " + str(!StreetPostDrctnAbbrev!) I get values like: 1498.0 None AVENUE K NONE NONE where I would expect: 1498 AVENUE K AddrPrimaryHighNo is Double StreetPreDrctnAbbrev is Text StreetName is Text StreetSuffixAbbrev is Text StreetostDrctnAbbrev is Text If I perform the field calculation below in ArcMap 10.5.1/VB Script, it works out just fine: [AddrPrimaryHighNo]&" "& [StreetPreDrctnAbbrev]&" "& [StreetName]&" "& [StreetSuffixAbbrev]&" "& [StreetPostDrctnAbbrev] Meanwhile I'm just going to go back to ArcMap. Thanks -Justin
... View more
09-04-2019
01:01 PM
|
2
|
5
|
5391
|
POST
|
The DBAs of our customer agency ended up using the delete/insert/update tables to create custom views for their analysis. This worked out well and avoided the need to enable historical versioning or geodatabase archiving. You are correct though to recommend leaving the underlying DBMS stuff alone, and thankfully so did this customer.
... View more
08-08-2019
04:37 AM
|
0
|
0
|
1082
|
Title | Kudos | Posted |
---|---|---|
1 | 06-16-2021 01:50 PM | |
2 | 12-09-2020 12:51 PM | |
1 | 12-04-2018 01:23 PM | |
1 | 03-16-2016 02:52 PM | |
1 | 05-10-2019 10:54 AM |
Online Status |
Offline
|
Date Last Visited |
03-19-2025
06:04 PM
|