Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
marishnagendran
Creator
Creator

Table Box or in Pivot Table

Hi All,

Product NameCustomer NameQtyNet Profit
Total 26598
Product ACustomer A102
 Customer B52
 Customer C155
 Customer D207
Product BCustomer E102
 Customer A245
 Customer B164
 Customer F5012
 Customer Z205
Product CCustomer Q4020
 Customer A202
 Customer B3532

 

This is my above transaction table.

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

Item GroupAvg_Net Profit
Product A4
Product B5.6
Product C18

 

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 NameCustomer NameQtyNet Profit
Product ACustomer A102
 Customer B52
Product BCustomer E102
 Customer A245
 Customer B164
 Customer Z205
Product CCustomer A202
9 Replies
marishnagendran
Creator
Creator
Author

Is it possible or not

Edvin
Creator
Creator

You could try something like this:

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

marishnagendran
Creator
Creator
Author

Thanks for your reply..

It's not working edvin

lanlizgu
Creator III
Creator III

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()
)

 

 

marishnagendran
Creator
Creator
Author

It's not working

lanlizgu
Creator III
Creator III

It works perfectly. PFA a .qvf attached

marishnagendran
Creator
Creator
Author

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

lanlizgu
Creator III
Creator III

could you please share your data so I could check?

marishnagendran
Creator
Creator
Author

Net Profit Column is based on Expression

((Sum(kpi_MR)/100000 )

/

(Sum(Kpi_SaleValue)/100000) * 100