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

To find the No of Products

Hi  all,

I want to find

If each product uses 1 lower arm, 20 screws, 2 upper arms and 2 housings, how many complete products can i assemble?


       

MachineNumberStartStopProgramCoolantPumpedRPMOpID
107:3008:00Lower Arm2220004
108:1008:50Lower Arm4780004
108:3008:40DETECT STOP004
109:1509:40Lower Arm2422004
109:4710:23Lower Arm2220004
110:3511:05Lower Arm2723004

       

207:0507:10Housing597173
207:1107:13Housing5103983
207:1607:21Housing599883
207:2707:30Housing5109003
207:3807:42Housing5101843
207:4907:54Housing599253
208:0008:03Housing5105333
208:1108:13Housing5107313
208:2208:24Housing5108623
208:3308:35Housing5108593
208:4408:49Housing590183
208:5509:00DETECT STOP003
209:0609:17Housing591713

       

307:0207:03Screw0.23001
307:0407:05Screw0.23001
307:0607:07Screw0.23001
307:0807:09Screw0.23001
307:1007:11Screw0.23001
307:1207:13Screw0.23001
307:1407:15Screw0.23001
307:1607:17Screw0.23001
307:1807:19Screw0.23001
307:2507:26Screw0.23001
307:2707:28Screw0.23001
307:2907:30Screw0.23001
307:3107:32Screw0.23001

       

408:0009:05Upper Arm601200010
409:3010:25Upper Arm601200010
410:5011:49Upper Arm601200010
412:0913:02Upper Arm601200010
413:3014:21Upper Arm601200010
414:4515:31Upper Arm601200010
415:5916:49Upper Arm601200010
417:2418:21Upper Arm601200010
418:5619:51Upper Arm601200010
508:0509:04Upper Arm601200010
509:2810:15Upper Arm601200010
1 Solution

Accepted Solutions
sunny_talwar

In this example, there won't be even a single product made because there are only 13 screws available. But assuming you need only 13 screws, you can try this:

=RangeMin(Floor(Count({<Program = {'Housing'}>}Program)/2),

   Floor(Count({<Program = {'Lower Arm'}>}Program)/1),

   Floor(Count({<Program = {'Screw'}>}Program)/13),

   Floor(Count({<Program = {'Upper Arm'}>}Program)/2))

For 20, you can do this:

=RangeMin(Floor(Count({<Program = {'Housing'}>}Program)/2),

   Floor(Count({<Program = {'Lower Arm'}>}Program)/1),

   Floor(Count({<Program = {'Screw'}>}Program)/20),

   Floor(Count({<Program = {'Upper Arm'}>}Program)/2))

View solution in original post

8 Replies
sunny_talwar

Not sure I understand, what would be the expected output from the sample data you have provided?

ajsjoshua
Specialist
Specialist
Author

Hi Sunny,

I want to find how many Products i can produce.

A Product can be made if we have 1 lower arm, 20 screws, 2 upper arms and 2 housings.

richard_chilvers
Specialist
Specialist

Joshua - so if, for example, you have lots of screws, upper arms and housing, but only 2 lower arms, that limits you to making just 2 products?

If so, you can count the totals of each of these components and then do the maths.

You might like to use the FLOOR function.

ajsjoshua
Specialist
Specialist
Author

Hi Ritchard,

can you make it in expression.

ajsjoshua
Specialist
Specialist
Author

Dear Sunny T

Are u clear  with What i am expecting.

sunny_talwar

In this example, there won't be even a single product made because there are only 13 screws available. But assuming you need only 13 screws, you can try this:

=RangeMin(Floor(Count({<Program = {'Housing'}>}Program)/2),

   Floor(Count({<Program = {'Lower Arm'}>}Program)/1),

   Floor(Count({<Program = {'Screw'}>}Program)/13),

   Floor(Count({<Program = {'Upper Arm'}>}Program)/2))

For 20, you can do this:

=RangeMin(Floor(Count({<Program = {'Housing'}>}Program)/2),

   Floor(Count({<Program = {'Lower Arm'}>}Program)/1),

   Floor(Count({<Program = {'Screw'}>}Program)/20),

   Floor(Count({<Program = {'Upper Arm'}>}Program)/2))

ajsjoshua
Specialist
Specialist
Author

Dear Bro,

Thank You very much.

sunny_talwar

No problem at all