Many functions (including the lookup functions) accept or require arrays as inputs. Such functions are NOT array functions.
Array functions return an array.
In current versions of Excel functions that return arrays do so automatically. It's no longer necessary to explicitly enter them as...
Offhand, I see these problems:
"*" is an illegal character in a file name, so there can never be any files that .endswith('*.txt') so src_files will always be empty.
today is not defined.
dest_files is not defined
Since you're using r strings you don't need to escape the slashes in the paths...
Hi remeng,
Thanks for attaching the spreadsheet.
However, the spreadsheet that you attached is quite different from everything that you've posted so far:
It introduces "Serial Number" that hasn't been discussed at all.
In the Component table, the listed "Comp_Qty" is 1 for every serial...
Start with two tables. One to define what parts are in each kit, a second to define how many of each kit are required.
Then use Power Query LeftOuter join to get this table:
Then pivot that to get what you want:
I think your problem is that the data doesn't contain this requirement.
You have 24 rows, indicating that 16 screws have been used 24 times.
There's nothing that says 24 is the correct number.
So what's wrong in your first pivot?
You get the correct Component Quantities.
You get the number of kits.
As a bonus you get confirmation that each component has been used in the same number of kits.
Potentially more useful to calculate 'parts per day per kit' in the data.
Kit
Kits used per day
Part
parts per kit
Parts per day per kit
K1
24
P1
2
48
K1
24
P2
1
24
K1
24
P3
16
384
K2
5
P1
3
15
K2
5
P2
4
20
K2
5
P4
1
5
Then you can use a pivot to report kit-wise:
Kit
Kits...
Like this:
Data in left 4 columns, Pivot table in the right 5 columns.
Kit
Kits used per day
Part
parts per kit
Kit
Kits used per day
Part
Sum of parts per kit
Sum of Parts used per day
K1
24
P1
2
K1
K1
24
P2
1
24
K1
24
P3
16
P1
2
48...
So each 12012-1133-00 kit contains:
2 x 18907-6791-34
1 x 19898-0153-00
16 x 19917-4387-36
???
In the underlying data, where are those 2, 1 and 16 factors?
In the underlying data, where is there a 24 indicating that you need 24 kits?
What's the use of the "X"?
Are you using it for something like "=if(C5="X","C5 is an X", "C5 is not X")
If so, then toggle a BOOLEAN in C5 so that it's directly useable.
You'll need to add the RTF encoding to the ASCII strings you're working with.
Or maybe you can read the RTF template inclusive of encoding, then change only the text and drop the whole thing back in.
https://en.m.wikipedia.org/wiki/Rich_Text_Format
Too bad, can't drag and drop arbitrary file types to attach.
Can't use the Attach files button to attach arbitrary files. Only a limited set of file types allowed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.