Re: sas va calculate rate between first N revenue and total revenue

There are a couple ways to get what you want, but I think the most flexible way is to create a parameter 'topN_cutoff' and a calculation 'topN_revenue' like:

if 'revenue'n > 'topN_cutoff'

return 'revenue'n

else 0

Then you can create an aggregated calculation like this:

sum [_ForAll_] ('topN_revenue'n) / sum [_ForAll_] ( 'revenue'n )

The only sticky point is that you need to know what the cutoff revenue is beforehand. For any given data, it is easy to find it out with a list table and a rank applied for top 3 (or whatever rank). But I don't think VA has an operator you can use to determine it automatically. The closest would be the Percentile operator which gives you the revenue value in the data for a specified percentile, but that won't correspond to a specific numeric rank (unless, again, you already know the data and can just determine what percentile corresponds with top N).

Re: sas va calculate rate between first N revenue and total revenue

There are a couple ways to get what you want, but I think the most flexible way is to create a parameter 'topN_cutoff' and a calculation 'topN_revenue' like:

if 'revenue'n > 'topN_cutoff'

return 'revenue'n

else 0

Then you can create an aggregated calculation like this:

sum [_ForAll_] ('topN_revenue'n) / sum [_ForAll_] ( 'revenue'n )

The only sticky point is that you need to know what the cutoff revenue is beforehand. For any given data, it is easy to find it out with a list table and a rank applied for top 3 (or whatever rank). But I don't think VA has an operator you can use to determine it automatically. The closest would be the Percentile operator which gives you the revenue value in the data for a specified percentile, but that won't correspond to a specific numeric rank (unless, again, you already know the data and can just determine what percentile corresponds with top N).