# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor

## Table Box or in Pivot Table

Hi All,

 Product Name Customer Name Qty Net Profit Total 265 98 Product A Customer A 10 2 Customer B 5 2 Customer C 15 5 Customer D 20 7 Product B Customer E 10 2 Customer A 24 5 Customer B 16 4 Customer F 50 12 Customer Z 20 5 Product C Customer Q 40 20 Customer A 20 2 Customer B 35 32

This is my above transaction table.

I want to calculate Every product Average Net Profit based on above transaction table (i.e)

 Item Group Avg_Net Profit Product A 4 Product B 5.6 Product C 18

Once calculated i want to compare with each product average with transaction table.

If value is less than the average i want to take that transaction (i.e)

My Output

 Product Name Customer Name Qty Net Profit Product A Customer A 10 2 Customer B 5 2 Product B Customer E 10 2 Customer A 24 5 Customer B 16 4 Customer Z 20 5 Product C Customer A 20 2
9 Replies
Contributor

## Re: Table Box or in Pivot Table

Is it possible or not

New Contributor III

## Re: Table Box or in Pivot Table

You could try something like this:

=IF(aggr(avg([Net Profit]),[Product name])<[Net Profit],[Product Name])

Contributor

## Re: Table Box or in Pivot Table

It's not working edvin

Contributor III

## Re: Table Box or in Pivot Table

Straight Table with Product Name and Customer Name as dimensions and the following expressions:

if([Net Profit]<
(sum(total <[Product Name]>[Net Profit])
/
count(total <[Product Name]> [Customer Name])
)
,[Net Profit]
,null()
)

if([Net Profit]<
(sum(total <[Product Name]>[Net Profit])
/
count(total <[Product Name]> [Customer Name])
)
,Qty
,null()
)

Contributor

It's not working

Contributor III

## Re: Table Box or in Pivot Table

It works perfectly. PFA a .qvf attached

Contributor

## Re: Table Box or in Pivot Table

I think my net profit column is calculated field that's why it shows syntax error

Contributor III