1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| MaterialCategory:
LOAD
//--------------- Material Category Code------------------------------
if(([Material category code] like 'M*') = 0 OR LEN([Material category code]) < 3,
if(MsgBox('La valeur du Material category code : ' & [Material category code] & ' semble incohérente.
Voulez vous la corriger manuellement ?
(Non = Rejet de la valeur)',
'Effectuer la correction ?', 'YESNO', 'ICONQUESTION', 'DEFBUTTON1') <> 6,
'',
//----------------------------------- Probleme------------------------------------------------------------------
SET rep = Input('Veuillez corriger la valeur : ' & [Material category code], 'Correction de la valeur')
if(isNull($('rep')) = -1,
MsgBox('Aucune valeur saisie, la valeur est rejetée'),
$('rep')
)
),
if(LEN([Material category code]) > 3, //then
LEFT([Material category code], 3),
[Material category code]
)
) as [Material category code],
//-----------------Description----------------------------------------
Description as [Material category description],
//-----------------Safety Stocks--------------------------------------
IF(IsNull([Safety stock]) = -1 OR IsNum([Safety stock]) <> -1,
'N/A',
IF([Safety stock] < 0 OR Frac([Safety stock]) <> 0 ,
if(MsgBox('La valeur du safety stock : ' & [Safety stock] & ' est incohérente.
Voulez vous la corriger par la valeur : ' & Evaluate(FABS([Safety stock]) - Frac(FABS([Safety stock]))) & ' ?
(Non = N/A)',
'Effectuer la correction ?', 'YESNO', 'ICONQUESTION', 'DEFBUTTON1') <> 6,
'N/A',
FABS([Safety stock]) - Frac(FABS([Safety stock]))
),
[Safety stock]
)
) as [Material category safety stocks]
FROM [LoadFolder\data.xlsx]
(ooxml, embedded labels, table is [Material category])
WHERE NOT Exists([Material category code]); |
Partager