Skip to content

Commit

Permalink
Example 78
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Nov 20, 2024
1 parent 616b74d commit d56627c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3628,12 +3628,11 @@ <h2 id="72-standard-aggregation-methods"><a id="StandardAggregationMethods" href
<span id="cb144-6"><a href="#cb144-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span> <span class="dt">&quot;ID&quot;</span><span class="fu">:</span> <span class="st">&quot;P3&quot;</span><span class="fu">,</span> <span class="dt">&quot;Name&quot;</span><span class="fu">:</span> <span class="st">&quot;Paper&quot;</span><span class="fu">,</span> <span class="dt">&quot;Color&quot;</span><span class="fu">:</span> <span class="st">&quot;White&quot;</span><span class="fu">,</span> <span class="dt">&quot;TaxRate&quot;</span><span class="fu">:</span> <span class="dv">0</span><span class="er">.</span><span class="dv">14</span><span class="fu">,</span></span>
<span id="cb144-7"><a href="#cb144-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Total@type&quot;</span><span class="fu">:</span> <span class="st">&quot;Decimal&quot;</span><span class="fu">,</span> <span class="dt">&quot;Total&quot;</span><span class="fu">:</span> <span class="dv">8</span> <span class="fu">}</span><span class="ot">,</span></span>
<span id="cb144-8"><a href="#cb144-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span> <span class="dt">&quot;ID&quot;</span><span class="fu">:</span> <span class="st">&quot;P4&quot;</span><span class="fu">,</span> <span class="dt">&quot;Name&quot;</span><span class="fu">:</span> <span class="st">&quot;Pencil&quot;</span><span class="fu">,</span> <span class="dt">&quot;Color&quot;</span><span class="fu">:</span> <span class="st">&quot;Black&quot;</span><span class="fu">,</span> <span class="dt">&quot;TaxRate&quot;</span><span class="fu">:</span> <span class="dv">0</span><span class="er">.</span><span class="dv">14</span><span class="fu">,</span></span>
<span id="cb144-9"><a href="#cb144-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Total&quot;</span><span class="fu">:</span> <span class="kw">null</span> <span class="fu">}</span><span class="ot">,</span></span>
<span id="cb144-9"><a href="#cb144-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Total&quot;</span><span class="fu">:</span> <span class="kw">null</span> <span class="fu">}</span><span class="ot">,</span></span>
<span id="cb144-10"><a href="#cb144-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span> <span class="dt">&quot;ID&quot;</span><span class="fu">:</span> <span class="st">&quot;P1&quot;</span><span class="fu">,</span> <span class="dt">&quot;Name&quot;</span><span class="fu">:</span> <span class="st">&quot;Sugar&quot;</span><span class="fu">,</span> <span class="dt">&quot;Color&quot;</span><span class="fu">:</span> <span class="st">&quot;White&quot;</span><span class="fu">,</span> <span class="dt">&quot;TaxRate&quot;</span><span class="fu">:</span> <span class="dv">0</span><span class="er">.06</span><span class="fu">,</span></span>
<span id="cb144-11"><a href="#cb144-11" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Total@type&quot;</span><span class="fu">:</span> <span class="st">&quot;Decimal&quot;</span><span class="fu">,</span> <span class="dt">&quot;Total&quot;</span><span class="fu">:</span> <span class="dv">4</span> <span class="fu">}</span></span>
<span id="cb144-12"><a href="#cb144-12" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span></span>
<span id="cb144-13"><a href="#cb144-13" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
<p>The expression <code>$it/Sales</code> refers to the sales of the current product. Without <code>$it</code>, all sales of all products would be aggregated, because the input collection for the <code>aggregate</code> function consists of all products.</p>
</div>
<div class="example">
<p>Example 79: Alternatively, <code>join</code> could be applied to yield a flat structure:</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3471,14 +3471,12 @@ results in
{ "ID": "P3", "Name": "Paper", "Color": "White", "TaxRate": 0.14,
"Total@type": "Decimal", "Total": 8 },
{ "ID": "P4", "Name": "Pencil", "Color": "Black", "TaxRate": 0.14,
"Total": null },
"Total": null },
{ "ID": "P1", "Name": "Sugar", "Color": "White", "TaxRate": 0.06,
"Total@type": "Decimal", "Total": 4 }
]
}
```

The expression `$it/Sales` refers to the sales of the current product. Without `$it`, all sales of all products would be aggregated, because the input collection for the `aggregate` function consists of all products.
:::

::: example
Expand Down
4 changes: 1 addition & 3 deletions odata-data-aggregation-ext/7 Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,12 @@ results in
{ "ID": "P3", "Name": "Paper", "Color": "White", "TaxRate": 0.14,
"Total@type": "Decimal", "Total": 8 },
{ "ID": "P4", "Name": "Pencil", "Color": "Black", "TaxRate": 0.14,
"Total": null },
"Total": null },
{ "ID": "P1", "Name": "Sugar", "Color": "White", "TaxRate": 0.06,
"Total@type": "Decimal", "Total": 4 }
]
}
```

The expression `$it/Sales` refers to the sales of the current product. Without `$it`, all sales of all products would be aggregated, because the input collection for the `aggregate` function consists of all products.
:::

::: example
Expand Down

0 comments on commit d56627c

Please sign in to comment.