Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
diffeyj
Partner - Contributor III
Partner - Contributor III

Limiting 1 dimension on another dimensions top x

So I have a qvw where by I am showing the top 10 customers by gross profit

RankCustomerGross Profit
1Customer A90,000
2Customer B80,000
3Customer C70,000
...
10Customer J40,000

For these top 10 customers I want to show a pie chart by income stream (eg. Private Sector, Government Sector, Mining Sector, etc.). So the dimension on the Pie Chart currently is Income Stream.

So if the top 10 customers didn't include any income from the Mining Sector, I don't want them included in the Pie Chart.

In addition I don't want to include any income from customers not in the top 10. So if out of the top 10 customers, $30,000 was spent on the Private Sector, that slice of the Pie Chart should be $30,000.

Does anyone have any ideas?

I assume I need to do something using the Rank Function, but I can't work out where/how is the best to do it.

The expression is already a set analysis

sum({<isParentJobClosed={0},[Period End Date]= {"<=$(=SelectedPeriodEnd)"}>+<isParentJobClosed={1},ParentJobCompleteDate={">=$(=SelectedFinancialYearStart)"},[Period End Date]= {"<=$(=SelectedPeriodEnd)"}> } SalesLineRetail)

1 Reply
Anil_Babu_Samineni

From given expression? Won't work for single degrade field. The highlight one ignores.

SelectedPeriodEnd is the field or Variable?

sum({<isParentJobClosed={0},[Period End Date]= {"<=$(=SelectedPeriodEnd)"}>+<isParentJobClosed={1},ParentJobCompleteDate={">=$(=SelectedFinancialYearStart)"},[Period End Date]= {"<=$(=SelectedPeriodEnd)"}> } SalesLineRetail)


To answer your question, Perhaps this?


sum({<isParentJobClosed={0},[Period End Date]= {"<=$(=SelectedPeriodEnd)"}>+<isParentJobClosed={1},ParentJobCompleteDate={">=$(=SelectedFinancialYearStart)"}, Customer = {"=Rank(Sum([Gross Profit),4)<=10"}> } SalesLineRetail)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful