Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
15 lines
742 B
Plaintext
15 lines
742 B
Plaintext
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
|
@EndUserText.label: 'Sales items by region and size class'
|
|
define view entity {{P}}I_SALES_CLASS
|
|
as select from {{p}}sale
|
|
{
|
|
key region as region,
|
|
count( * ) as item_count,
|
|
sum( case when amount < 100 then 1 else 0 end ) as small_count,
|
|
sum( case when amount >= 101 and amount < 1000 then 1 else 0 end ) as medium_count,
|
|
sum( case when amount >= 1000 then 1 else 0 end ) as large_count,
|
|
sum( amount ) as total_amount
|
|
}
|
|
where status <> 'X'
|
|
group by region
|