2 Replies Latest reply: Nov 2, 2015 4:02 PM by Carlo Rotini

# Building a KPI of a category based on current selection

Hi community,

I'd like to build a kpi that shows sales of a product category, based on the current selection of a product.

e.g. Selecting "Salad", I want that my kpi returns the sales of the product category "Vegetables", while selecting "Milk" my kpi should return sales of the "Dairy products" category.

How can I solve that?

Thanks for the support,

Carlo

• ###### Re: Building a KPI of a category based on current selection

maybe

sum({\$ <product=,productcategory=p(productcategory)>} sales)

• ###### Re: Building a KPI of a category based on current selection

Thanks, it seems to work.

Could you tell me how the expression you suggested works exactly (or where I can find out more about it)?

I cannot understand it completely.

Furthermore I'm don't get what the kpi measures when no selection is made, because it doesn't seem to be equal to sum(sales), and also when multiple selection is made.

This expression is going to be very helpful for many different calculations.