Difference between revisions of "ComputeCloud Formula Examples"

From dataZoa Wiki
Jump to: navigation, search
(Created page with " === Simple Examples: === <div style="margin:2em; margin-left:6em;"> <table class="Gbb1" style="width:100%;font-size:smaller;"> <tr> <td style="width:35%;font-size:larger;"...")
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
  
=== Simple Examples: ===
+
=== Formulas with just one input Variable <i>V1</i>: ===
 
<div style="margin:2em; margin-left:6em;">
 
<div style="margin:2em; margin-left:6em;">
<table class="Gbb1" style="width:100%;font-size:smaller;">
+
<table class="Gbb1" style="width:100%;font-size:smaller; cell-padding: 0.5em; line-height: 3.0em;">
 
  <tr>
 
  <tr>
   <td style="width:35%;font-size:larger;"><b>Purpose</b></td>
+
   <td style="width:20%;font-size:larger;"><b>Purpose</b></td>
   <td style="width:65%;font-size:larger;"><b>Formula</b></td>
+
   <td style="width:30%;font-size:larger;"><b>Formula</b></td>
 +
  <td style="width:50%;font-size:larger;"><b>Notes</b></td>
 
  </tr>
 
  </tr>
  <tr><td>Enable crosshairs on hover for: <i>[x-axis, y-axis]</i></td>
+
  <tr><td>Simple 10 Point Moving Average</td><td>Movavg(V1,10)</td></tr>
  <td>
+
<tr><td>Remove Mean</td><td>V1-Mean(V1)</td><td></td></tr>
<nowiki>{
+
  <tr><td>Index to 100</td><td>Index(V1)</td><td></td></tr>
  tooltip: { crosshairs:[false, true] }
+
<tr><td>Percent Change</td><td>Index(v1)-100</td><td></td></tr>
}</nowiki>
+
  <tr><td>Convert to Quarterly</td><td>SetFreq(V1, 'Quarterly', 'Avg', 'PrecAuto', 'Trim')</td><td>Many details to consider in Periodicity conversions!</td></tr>
  </td>
+
  <tr><td>Replicate a series but with a constant value</td><td>(v1-v1)+3.14159</td><td>Subtracting V1 from itself gives a series with all zeroes but preserves the Periodicity and dates.</td></tr>
</tr>
+
  <tr><td>Average just the latest 10 points of a Series</td><td>v1-v1+mean(extract(V1,length(V1)-9,10))</td><td>Preserves Periodicity and dates.</td></tr>
  <tr><td>Set tooltip prefix, suffix, decimals and date format (<i>%B= Month full name, %b = Month abbreviation, %m = Month number, %d = Day number, %Y = 4 digit year, %y = 2 digit year</i>).</td>
+
</table>
  <td>
+
  <nowiki>{
+
  tooltip: { valuePrefix:'$', valueSuffix:' USD', valueDecimals:2, xDateFormat:'%b-%d-%Y' }
+
}</nowiki>
+
  </td>
+
</tr>
+
  <tr><td>Separate tooltips for each series displayed one-at-a-time (e.g. for whichever series is being hovered over).</td>
+
  <td>
+
<nowiki>{
+
  tooltip: { shared:false }
+
}</nowiki>
+
  </td>
+
</tr>
+
  <tr><td>Separate tooltips foe each series displayed simultaneously.</td>
+
  <td>
+
<nowiki>{
+
  tooltip: { split:true }
+
}</nowiki>
+
  </td>
+
</tr>
+
</table>
+
 
</div>
 
</div>
 +
[[Category:Calculations]][[Category:Creating]][[Category:Advanced]]

Latest revision as of 12:31, 24 January 2019

Formulas with just one input Variable V1:

Purpose Formula Notes
Simple 10 Point Moving AverageMovavg(V1,10)
Remove MeanV1-Mean(V1)
Index to 100Index(V1)
Percent ChangeIndex(v1)-100
Convert to QuarterlySetFreq(V1, 'Quarterly', 'Avg', 'PrecAuto', 'Trim')Many details to consider in Periodicity conversions!
Replicate a series but with a constant value(v1-v1)+3.14159Subtracting V1 from itself gives a series with all zeroes but preserves the Periodicity and dates.
Average just the latest 10 points of a Seriesv1-v1+mean(extract(V1,length(V1)-9,10))Preserves Periodicity and dates.