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: 
KevinJ
Contributor III
Contributor III

RANK WITH SET ANALYSIS

I forgot to include the ranking would also be a set analysis of Currency = PHP, and Item Type Inventory Item. How would that be possible? 

 

Item Name Subtotal PO Currency Item Type
Product 1 500 1 PHP Inventory Item
Product 2 250   EUR Service
Product 1 500 1 PHP Inventory Item
Product 2 250 2 EUR Inventory Item
Product 2 250 1 EUR Inventory Item
Product 1 5000 2 EUR Inventory Item
         
Output:        
Rank  Item Name TOTAL PO Total  
1 Product 1 2 1000  
2 Product 2 3 500  

 

 

This is my original code

=aggr(if (rank( total sum([Subtotal]))<=10,sum(num([Subtotal],'#,##0.00'))),[Item Name])

 

then i tweak it to be a set analysis ranking but this doesnt show anything.

=aggr(if (rank( total sum({$<[Item Type]={'Inventory Item'}, Currency = {'PHP'}>},[Subtotal]))<=10,sum(num([Subtotal],'#,##0.00'))),[Item Name])

Labels (5)
1 Solution

Accepted Solutions
Aasir
Creator III
Creator III

little change in the place of your brackets

=aggr(
if(
rank(
total
sum({$<[Item Type]={'Inventory Item'}, Currency={'PHP'}>} [Subtotal])
) <= 10,
sum(num([Subtotal], '#,##0.00'))
),
[Item Name]
)

View solution in original post

1 Reply
Aasir
Creator III
Creator III

little change in the place of your brackets

=aggr(
if(
rank(
total
sum({$<[Item Type]={'Inventory Item'}, Currency={'PHP'}>} [Subtotal])
) <= 10,
sum(num([Subtotal], '#,##0.00'))
),
[Item Name]
)