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

Worst Selling 5 Products?

Hi,

Need to find worst selling 5 product Rank field using below rule,

Tried to create below kind of calculated dimension but it's not working. just shows 0. how to resolve this issue? any suggestions. tks

=aggr(

if(

rank(-(Sum(SoldQty)/Count(DISTINCT ShopNo)),4)<=5

and sum(soh)>=400

and count(distinct ShopNo)>20

and StockType='Seasonal'

and Repeat_Status='0'

and [# Wks Launched]>2

,ArticleNo)

,ArticleNo)

expected output based on above expression

Expected output.png

Expected

Thanks,

Deva

36 Replies
sunny_talwar

For this new sample you attached, what is the expected output? I am seeing that one of the set analysis condition isn't getting met

ArticleNo = {"=Sum({<Year={'*'},Week={'*'}>} SoldQty)/sum({<Year={'*'}, Week={'*'}, Type_ID={'NB'}>} OrderQty) <= 0.5"}

There is only two Articles that show up and both of them are above 0.5

Capture.PNG

devarasu07
Master II
Master II
Author

Hi stalwar1‌,

i'm checking on the expected output with the current figure. Can you share your expression. tks

sunny_talwar

Only thing you had wrong in your expression was the misplacement of a parenthesis... but that still doesn't resolve the issue

=Aggr(If(rank(-sum({<SoldQty={'>0'},Repeat_Status={'0'}, [# Wks Launched]={"=avg([# Wks Launched])>2 and avg([# Wks Launched])<=13"},

ArticleNo = {"=Sum({<Year={'*'},Week={'*'}>} SoldQty)/sum({<Year={'*'},Week={'*'} ,Type_ID={'NB'}>} OrderQty)<=0.5"}>}SoldQty)/

count(DISTINCT {<StoreName-={'KM','PWP','CK Ware House','CKS-WHS','CKS-DI','Virtual Sloc CN'},soh={"=sum({<Week={$(vSOHWeek)},soh={'>1'}>}soh)"}>}StoreName))<=5,

Only({<SoldQty={'>0'},Repeat_Status={'0'}, [# Wks Launched]={"=avg([# Wks Launched])>2 and avg([# Wks Launched])<=13"},

ArticleNo = {"=Sum({<Year={'*'},Week={'*'}>} SoldQty)/sum({<Year={'*'},Week={'*'} ,Type_ID={'NB'}>} OrderQty)<=0.5"}>}ArticleNo)), ArticleNo)

devarasu07
Master II
Master II
Author

Hi stalwar1‌,

above expression not working. can you share your app (latest expression applied one). many thanks

sunny_talwar

I don't have a working solution... for the sample you have shared, I don't even think there are any articles which meet one of your conditions

ArticleNo where Sum({<Year={'*'},Week={'*'}>} SoldQty)/sum({<Year={'*'}, Week={'*'}, Type_ID={'NB'}>} OrderQty) <= 0.5

devarasu07
Master II
Master II
Author

Hi stalwar1‌,

Noted, in your previous reply with screen shot able to show the two article right. just wanted to see then i will explore it. can u share that two showing result.tks

my side am not getting those two article. just want to see how your show that 2 article.

sunny_talwar

Sure