Edit at the bottom.
So I am creating a script tool to be able to provide reports on a weekly basis without having to enter in the parameters over and over again where as I can just click a button to run it for me in the form of a script tool.
Here's what my script looks like:
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">import</SPAN> os
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping <SPAN class="keyword token">as</SPAN> map
<SPAN class="keyword token">from</SPAN> arcpy <SPAN class="keyword token">import</SPAN> env
<SPAN class="keyword token">import</SPAN> datetime
mxd <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>MapDocument<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Current"</SPAN><SPAN class="punctuation token">)</SPAN>
slackFeatures <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'Slack Features'</SPAN>
date <SPAN class="operator token">=</SPAN> datetime<SPAN class="punctuation token">.</SPAN>date<SPAN class="punctuation token">.</SPAN>today<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
reportsGDB <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'\\Desktop\Summary_Report\Slack_Summary_Reports.gdb'</SPAN>
reportsFolder <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'\\Desktop\Summary_Reports'</SPAN>
inLayer <SPAN class="operator token">=</SPAN> slackFeatures
outputName <SPAN class="operator token">=</SPAN> <SPAN class="string token">'slack_summary'</SPAN>
outLayer <SPAN class="operator token">=</SPAN> reportsGDB <SPAN class="operator token">+</SPAN> <SPAN class="string token">"/"</SPAN> <SPAN class="operator token">+</SPAN> outputName
statsFields <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">"footage"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"SUM"</SPAN><SPAN class="punctuation token">]</SPAN>
caseFields <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">"NetworkID"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ProjectID"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"type"</SPAN><SPAN class="punctuation token">]</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Statistics_analysis<SPAN class="punctuation token">(</SPAN>inLayer<SPAN class="punctuation token">,</SPAN> outLayer<SPAN class="punctuation token">,</SPAN> statsFields<SPAN class="punctuation token">,</SPAN> caseFields<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This gives me the Error 000800: The value is not a member of SUM | MEAN | MIN | MAX | RANGE | STD | COUNT | FIRST | LAST.
Inputting these parameters manually into the Summary Statistics tool works but it doesn't in the script. I am currently out of ideas to solve this and am open to ideas to try out.
The field footage is a Long field and works manually in the Summary Statistics tool but does not work in the script. I tried the summary statistics tool on another feature class and the custom fields we have in that are Double which the summary statistics works fine for in the script. I tried it on a Long field again for the feature class with the custom fields and the summary statistics throws back the same error.
Why the Summary Statistics tool not work in a script for Long fields but would work for Double fields?