BookmarkSubscribeRSS Feed
emilyaaa
Calcite | Level 5

Dear All,

 

I want to implement a calculated item from aggregation of an aggregation. In Tableau I would use LOD function, example:

I want to flag those user with weighted average price over the Role_Bandmax to be 'too_expensive', otherwise just as same as Tier_Role column.

 

In the table, for TOM, his average price is $174.29, it is over his Role_Bandmax  110, so TOM should be flagged as  'too_expensiv'

 For JERRY, his  average price is $108,27, it is lower than his Role_Bandmax, 130, so JERRY should be flagged as same as his Tier_Role, that is 'tier2'

Transaction_IDUser_IDUser_RoleRole_BandmaxTier_Rolepriceamountweighted avg pricenew_Flag
1TOMdeveloper110tier11001174,2857143too_expensive
2TOMdeveloper110tier1902174,2857143too_expensive
3TOMdeveloper110tier11203174,2857143too_expensive
4TOMdeveloper110tier13002174,2857143too_expensive
5TOMdeveloper110tier12005174,2857143too_expensive
6TOMdeveloper110tier12001174,2857143too_expensive
7JERRYAdmin130tier21103108,2666667tier2
8JERRYAdmin130tier21204108,2666667tier2
9JERRYAdmin130tier21405108,2666667tier2
10JERRYAdmin130tier21206108,2666667tier2
11JERRYAdmin130tier21107108,2666667tier2
12JERRYAdmin130tier21308108,2666667tier2
13JERRYAdmin130tier21109108,2666667tier2
14JERRYAdmin130tier29010108,2666667tier2
15JERRYAdmin130tier29011108,2666667tier2
16JERRYAdmin130tier210012108,2666667tier2

 

Thanks in advance!

 

2 REPLIES 2
Madelyn_SAS
SAS Super FREQ

This is posted to the SAS Visual Analytics community but it does not seem like a VA issue. Which SAS product are you using? For example, SAS Studio? 

emilyaaa
Calcite | Level 5
Hi,

Thx for reply!
I use SAS viya for visual Analytics
As I can do such calculation in other visual Analytics tool, so i would ask how to implement it in SAS way

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 926 views
  • 0 likes
  • 2 in conversation