Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
A_Tan
Contributor
Contributor

Filter by column and average Aggr

Hi Qlik Community, i need some help here.

 

Sheet A:

A_Tan_2-1631602646690.png

 

Sheet B:

A_Tan_1-1631602593194.png

In layman terms, i want to:

If B.Product = A.Product, Average ( Aggr ( (Hours /  Quantity), B.Product))

Result = 3.74

If B.product is contain in A.Product, find the average of aggr of (hour / quantity) by B.product.

Ie. Product A, C, D, F

 

Thanks, Alvin

1 Reply
MayilVahanan

Hi

Try like below

 

LOAD *, 1 as FlagA Inline
[
Product, Efficiency
A, 3.4
C, 5.1
D,4.1
F,2.2
];

Load * Inline
[
Product, Hours, Quantity
A, 31, 10
A, 33, 9
B, 51, 10
C, 21, 4
C, 22, 4
D, 8, 2
E, 71, 5
E, 75, 6
F, 66, 30
F, 63, 28
];

o/p:

MayilVahanan_0-1631612181411.png

 

Exp: Avg ({<FlagA = {1}>} Aggr ( Sum({<FlagA={1}>}Hours) / Sum({<FlagA={1}>}Quantity), Product))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.