Select to view content in your preferred language

Production of Graphs from Geodatabase Table

4930
32
Jump to solution
08-27-2013 09:17 AM
ModernElectric
Frequent Contributor
What I have is a table I produced from our Customer Information System showing the billed KWH Usage and KW Demand for a ALL electric meters over a period of time (From July 2011 to July 2013). There are about 900,000 records in this table of around 9500 electric meters. What I am trying to accomplish is listed below:

Attached: Example.xlsx

This is also in a File Geodatabase as a Geodatabase Table
This table is composed of around 9500 meter records (METER NUMBER)

1) Go through the table and find METER NUMBER record with the billing period, KWH and KW Demand rows attached.

2) Extract/export/select a unique METER NUMBER with the data attached (billing period, KWH and KW Demand)

3) Take the data and build a graph showing the Billing Period along the "X" Axis, KWH and KW Demand along the "Y" Axis

4) Export the graph to a .PDF with the METER NUMBER as the file name

From there I can use the Attachments Geoprocessing tool to take the .PDF and attach it to the Meter Location in the .MXD

Long Term Goal is to create a One-Touch custom Button to select a specific METER NUMBER to create a graph described above and automatically create a .PDF.

I know this sounds like a huge project - and want to learn how to build it piece by piece to eventually accomplish the Long Term Goal.

Thanks for your help in advanced
Tags (2)
32 Replies
ModernElectric
Frequent Contributor
Dave-

Thank you, but how should that look here??:

for n in list:
    arcpy.TableSelect_analysis(table, r"in_memory\table_sel", "TWACs_NUMBER = " + str(n))
    out_graph_name = n
    out_graph_pdf = r"C:\MEWCo GIS System\Electric Graphs\Electric Meters\F-1 Feeder" + "\\" + str(n) + ".pdf"
    input_template = r"C:\MEWCo GIS System\Electric Graphs\GIS Graph Temps\ELECTRIC METER DEMAND - KWH USAGE.grf"
    input_data = r"in_memory\table_sel"
0 Kudos
DaveBarrett
Deactivated User
Dave-

Thank you, but how should that look here??:

for n in list:     arcpy.TableSelect_analysis(table, r"in_memory\table_sel", "TWACs_NUMBER = " + str(n))     out_graph_name = n     out_graph_pdf = r"C:\MEWCo GIS System\Electric Graphs\Electric Meters\F-1 Feeder" + "\\" + str(n)[:-2] + ".pdf"     input_template = r"C:\MEWCo GIS System\Electric Graphs\GIS Graph Temps\ELECTRIC METER DEMAND - KWH USAGE.grf"     input_data = r"in_memory\table_sel"


Sorry meant to add that bit in. Where you specify the name of the PDF and use str(n) use str(n)[:-2]

Cheers

Dave
0 Kudos
ModernElectric
Frequent Contributor
Sorry meant to add that bit in. Where you specify the name of the PDF and use str(n) use str(n)[:-2]

Cheers

Dave


BINGO!!!!

That is exactly what I am looking for. The .PDFs are coming out exactly the way they need and are named properly. Thank you

I am doing more research on the graph itself.
0 Kudos