on 2015 Oct 16 3:53 PM
I have a bill of material list from a table, which I will try to convert over to a different BOM table. The list I have is based on a column with materials and levels. But I need to create a list of materials and components. I have illustrated below how the list looks and how I want to convert it. There can be up to 10 levels. But this is too tricky for me. Someone who can help me?
Exampel how it looks like today:
ID Material SLEVEL QTY
-----------------------------------------------------------
1 Material123 0 1
2 9515463A 1 1
3 1734279 2 1
4 3201463 2 4
5 9515463B 1 1
6 1734163 2 1
7 3201463 2 4
9 8349834 2 2
10 1349833 3 2
11 1463918 3 4
12 Material456 0 1
13 9512070 1 1
14 1621405 2 1
15 1734534 2 2
16 1734535 2 1
17 9513294 1 1
18 1621750 2 3
I want to make a SQL that change the BOM list so it becomes like this:
Material Component Qty SLevel
-------------------------------------------------
Material123 9515463A 1 0
Material123 1734279 1 0
Material123 3201463 1 0
Material123 9515463B 1 0
Material123 1734163 1 0
Material123 3201463 1 0
Material123 8349834 1 0
Material123 1349833 1 0
Material123 1463918 1 0
9515463A 1734279 1 1
9515463A 3201463 4 1
9515463B 1734163 1 1
9515463B 3201463 4 1
9515463B 8349834 2 1
8349834 1349833 2 2
8349834 1463918 4 2
Material456 9512070 1 0
Material456 1621405 1 0
Material456 1734534 1 0
Material456 1734535 1 0
Material456 9513294 1 0
Material456 1621750 1 0
9512070 1621405 1 1
9512070 1734534 2 1
9512070 1734535 1 1
9513294 1621750 3 1
User | Count |
---|---|
66 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.