Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ville
Contributor II
Contributor II

Count shipment with weight between 1000 and 3000

Hi everybody 

Tried my luck reading through the forum but couldn't find or understand the right solution for my problem. I am new to qlik to bear with me. 

I need to count the amount of shipments between 1000 and 3000g per partner. Idee is to get a table with the partners as a dimension.

The tricky part is to calculate the amounts of shipments in the weight range (1000-3000g). Shipment weights needs to be calculated over different datasets. All shipments have a unique ID "OrderID-orderID" and a shipment can have multiple items. Would need to calculate the shipment weight via "OrderID-orderID" and "weight". 

I thought it should work this way -> 

aggr(count(distinct[OrderID-orderID] ), Sum( weight, [OrderID-orderID]={">1000<=3000"}))

Tabel names are "Orders" and "OrderItems"

Any ideas where I went wrong? 

 

Seems I forgot/didn't get something, as it doesn't work. 

1 Solution

Accepted Solutions
JordyWegman
Partner - Master
Partner - Master

Hi Ville,

You can create this formula and use it with the dimension you want:

Count(Distinct {$< weight = {">1000<=3000"} >} OrderID-orderID)

 Jordy

Climber

Work smarter, not harder

View solution in original post

4 Replies
jfkinspari
Partner - Specialist
Partner - Specialist

Could you add a sample application?

ville
Contributor II
Contributor II
Author

Sure, sample file is added .  In the file you also see, that there are a lot more DB connected. This is just to show how the link is done to the delivery company from the order. Hope it helps. 

 

Thanks for the support! 

JordyWegman
Partner - Master
Partner - Master

Hi Ville,

You can create this formula and use it with the dimension you want:

Count(Distinct {$< weight = {">1000<=3000"} >} OrderID-orderID)

 Jordy

Climber

Work smarter, not harder
ville
Contributor II
Contributor II
Author

Hi Climber

Thanks that worked perfectly!