Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 78 #2030

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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