Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Two level of aggregation: Require help

I need to get Top 5 OtherBrandOwned and for those 5 top brands what are the Top 1 OtherModelOwned.

Data something like:

Image1.JPG

Output:

Image4.JPG

Image3.JPG

A3 Purchased - 3903

I am using text boxes to calculate these as we also need ratio of each value by Car Purchased -  A3/A4/A6 etc.

I am able to get Top 5 OtherBrandOwned by using Rank() with Aggr() as shown above.

However, I am unable to get Top 1 Models for each of these Brands correctly.

For 4th Brand - Hyundai, I am getting model as 'Innova' which is incorrect.It should be Hyundai and Verna.

For 5th Brand - Maruti, I am getting model as 'Verna' which is incorrect.It should be Maruti and Swift.

How to customize the expression to get correct values for top 1 model. Please help.

Message was edited by: Nidhi Gupta

1 Solution

Accepted Solutions
rahulpawarb
Specialist III
Specialist III

Hello Nidhi,

Thank you for sharing the application with sample data.

To fix this issue I have created variables to hold VehicleBrandName at various levels considering VehicleModelName and used those variables in the expressions.

Please refer updated application file attached herewith.

Regards!

Rahul

View solution in original post

5 Replies
rahulpawarb
Specialist III
Specialist III

Hello Nidhi,

Could you please share the application with sample data? This will help us to provide you required inputs.

Regards!

Rahul

Not applicable
Author

Attaching sample qv file.

rahulpawarb
Specialist III
Specialist III

Hello Nidhi,

Thank you for sharing the application with sample data.

To fix this issue I have created variables to hold VehicleBrandName at various levels considering VehicleModelName and used those variables in the expressions.

Please refer updated application file attached herewith.

Regards!

Rahul

Not applicable
Author

Hi Rahul,


It was a challenge for me to put aggr() inside an aggr() function.

Your solution is spot on !! Thanks

rahulpawarb
Specialist III
Specialist III

Thank you

Rahul