-
Notifications
You must be signed in to change notification settings - Fork 0
/
explanner_vfquotasplit.int
615 lines (579 loc) · 12.6 KB
/
explanner_vfquotasplit.int
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
// Script generated by DI Visual Integrator
version "1";
object 'PARM' "Parms" {
parms = {
{
name = "LETTER",
default = ""
},
{
name = "VND",
default = "false",
type = "boolean"
}
}
};
object 'TSKL' "Main" {
contents = {
`Join Tables and Split on Time`
}
};
object 'TASK' "Join Tables and Split on Time" {
inputs = {
`VF Quota`,
`Planner Goals`,
`Planner Goals Master`,
`Warehouse Master`,
`Item Master`,
`Planner VRC Groups`,
`State List`,
`VendorFilterCol Lookup`,
`Vendor Time`
},
processes = {
`squash vf quota`,
`Filter Planner Goals Master`,
`squash planner goals`,
`Join Planner Goals Master`,
`Filter Planner Goals`,
`Join Planner Goals`,
`Filter Out Planner Goals`,
`VF Quota Calcs`,
`Join Warehouse Master`,
`Join Item Master`,
`Calc Planner VRC Groups`,
`Join Planner VRC Groups`,
`State List Calcs`,
`Join State List`,
`Filter on State List`,
`Do Calcs`,
`Join Vendor Filter`,
`Filter Vendor`,
`Join Vendor Time`,
`Vendor Time Filter Calc`,
`Filter`,
`trace-1-TRA`
},
output = `Split`
};
object 'INPT' "VF Quota" {
//+ coordinatex = `158`,
//+ coordinatey = `8`,
input_type = `Filein`,
filenames = { `../data/current-goals.txt`, `../data/original-goals.txt` },
file_type = `column_headers`,
filename_column = `Goal Type`,
aliases = {
`Goal ID=Planner Quota Number`
}
};
object 'INPT' "Planner Goals" {
//+ coordinatex = `8`,
//+ coordinatey = `83`,
input_type = `filein`,
filenames = { `../../global/data/original-goals.txt` },
file_type = `column_headers`,
filename_column = `Filename`,
aliases = {
`Goal ID=Planner Quota Number`
},
keep_columns = {
`Planner Quota Number`
}
};
object 'INPT' "Planner Goals Master" {
//+ coordinatex = `8`,
//+ coordinatey = `158`,
input_type = `Filein`,
filenames = { `../../global/data/goal-master.txt` },
file_type = `column_headers`,
filename_column = `Filename`,
aliases = {
`Goal Type=Planner Vendor Flag`,
`Goal ID=Planner Quota Number`
},
keep_columns = {
`Planner Quota Number`,
`Planner Vendor Flag`
}
};
object 'INPT' "Warehouse Master" {
//+ coordinatex = `533`,
//+ coordinatey = `83`,
input_type = `Filein`,
filenames = { `../data/gogwmpdd.csv` },
dictfile = `../programs/gogwmp.dic`,
aliases = {
`Warehouse State Name=State Name`
},
keep_columns = {
`Warehouse Number`,
`Warehouse City`,
`Warehouse State`,
`State Name`,
`City Abbrev`,
`Old Warehouse Number`
}
};
object 'INPT' "Item Master" {
//+ coordinatex = `608`,
//+ coordinatey = `83`,
input_type = `Filein`,
filenames = { `../data/gowimpdd.csv` },
dictfile = `../programs/gowimp.dic`,
aliases = {
`Wine Gallons=Wine Gallons Conversion Factor`,
`Vendor Report Code=Vendor Report Code Name`
},
keep_columns = {
`Warehouse Number`,
`Item Number`,
`Pack Code`,
`Vendor Number`,
`Vendor Name`,
`Vendor Report Code Number`,
`Vendor Report Code Name`,
`Vendor Fiscal Month`,
`Wine Gallons Conversion Factor`
}
};
object 'INPT' "Planner VRC Groups" {
//+ coordinatex = `608`,
//+ coordinatey = `158`,
input_type = `Filein`,
filenames = { `../data/vrc-groups.txt` },
file_type = `column_headers`,
aliases = {
`State=Warehouse State`,
`Vendor Report Code Group=Vendor Report Group Desc`
}
};
object 'INPT' "State List" {
//+ coordinatex = `683`,
//+ coordinatey = `233`,
input_type = `Filein`,
file_type = `column_headers`,
filenames = { `../execmdls/exbuildorder.txt` },
aliases = {
`State Name=Buildorder Name`
}
};
object 'INPT' "VendorFilterCol Lookup" {
//+ coordinatex = `983`,
//+ coordinatey = `83`,
input_type = `Filein`,
filenames = { `../execmdls/exvndlookup.txt` },
delimiter = `\t`,
file_type = `column_headers`
};
object 'INPT' "Vendor Time" {
//+ coordinatex = `1133`,
//+ coordinatey = `83`,
input_type = `Filein`,
file_type = `column_headers`,
filenames = { `../temp/vfquotatime.txt` }
};
object 'PROC' "Squash VF Quota" {
//+ coordinatex = `233`,
//+ coordinatey = `8`,
process_type = `squash`,
input = `VF Quota`,
dimensions = {
`YearMo`,
`Item Number`,
`Pack Code`,
`Program`,
`Planner Quota Number`,
`Warehouse Number`,
`Goal Type`
},
summary = { `Units`, `Wine Gallons` }
};
object 'PROC' "Filter Planner Goals Master" {
//+ notes = ` 1=Vendor, 2=Program`,
//+ coordinatex = `83`,
//+ coordinatey = `158`,
process_type = `filter`,
input = `Planner goals Master`,
action = `keep`,
filters = {
{
column = `Planner Vendor Flag`,
values = { `1` }
}
}
// 1=Vendor, 2=Program
};
object 'PROC' "squash Planner goals" {
//+ coordinatex = `83`,
//+ coordinatey = `83`,
process_type = `squash`,
input = `planner goals`,
dimensions = { `Planner Quota Number` }
};
object 'PROC' "Join Planner Goals Master" {
//+ coordinatex = `158`,
//+ coordinatey = `83`,
process_type = `Lookup`,
inputs = {
`squash Planner Goals`,
`Filter Planner Goals Master`
},
multijoins = {
{`Planner Quota Number`, `Planner Quota Number` }
}
};
object 'PROC' "Filter Planner Goals" {
// another one to keep successful joins
//+ notes = ` another one to keep successful joins\n`
//+ ` 1=Vendor, 2=Program`,
//+ coordinatex = `233`,
//+ coordinatey = `83`,
process_type = `filter`,
input = `Join Planner goals master`,
action = `keep`,
filters = {
{
column = `Planner Vendor Flag`,
values = { `1` }
}
}
// 1=Vendor, 2=Program
};
object 'PROC' "Join Planner Goals" {
//+ coordinatex = `308`,
//+ coordinatey = `8`,
process_type = `Lookup`,
inputs = {
`Squash VF Quota`,
`Filter Planner Goals`
},
multijoins = {
{`Planner Quota Number`, `Planner Quota Number` }
}
};
object 'PROC' "Filter out Planner Goals" {
// another one to keep successful joins
//+ notes = ` another one to keep successful joins\n`
//+ ` 1=Vendor, 2=Program`,
//+ coordinatex = `383`,
//+ coordinatey = `8`,
process_type = `filter`,
input = `Join Planner goals`,
action = `keep`,
filters = {
{
column = `Planner Vendor Flag`,
values = { `1` }
}
}
// 1=Vendor, 2=Program
};
object 'PROC' "VF Quota Calcs" {
//+ coordinatex = `458`,
//+ coordinatey = `8`,
process_type = `calc`,
input = `Filter out Planner Goals`,
calcs = {
{
name = `Goal Type`,
value = `if(regexp(Goal Type,"current"),"current",if(regexp(Goal Type,"original`
`"),"original",""))`,
update = `true`
},
{
name = `YearMo`,
value = `replace(YearMo,"-","")`,
update = `true`
},
{
name = `Warehouse Number`,
value = `lpad(Warehouse Number,7,"0")`,
update = `true`
},
{
name = `Item Number`,
value = `lpad(Item Number,5,"0")`,
update = `true`
},
{
name = `Pack Code`,
value = `lpad(Pack Code,2,"0")`,
update = `true`
}
}
};
object 'PROC' "Join Warehouse Master" {
//+ coordinatex = `608`,
//+ coordinatey = `8`,
process_type = `Lookup`,
inputs = {
`trace-1-TRA`,
`Warehouse Master`
},
multijoins = {
{`Warehouse Number`, `Warehouse Number` }
}
};
object 'PROC' "Join Item Master" {
//+ coordinatex = `683`,
//+ coordinatey = `8`,
process_type = `Lookup`,
inputs = {
`Join Warehouse Master`,
`Item Master`
},
multijoins = {
{`Warehouse Number`, `Warehouse Number` },
{`Item Number`, `Item Number` },
{`Pack Code`, `Pack Code` }
}
};
object 'PROC' "Calc Planner VRC Groups" {
//+ coordinatex = `683`,
//+ coordinatey = `158`,
process_type = `calc`,
input = `Planner VRC Groups`,
calcs = {
{
name = `Vendor Number`,
value = `lpad(Vendor Number,7,"0")`,
update = `true`
},
{
name = `Vendor Report Code Number`,
value = `lpad(Vendor Report Code Number,2,"0")`,
update = `true`
},
{
name = `Vendor Report Group Number`,
value = `""`
}
}
};
object 'PROC' "Join Planner VRC Groups" {
//+ coordinatex = `758`,
//+ coordinatey = `8`,
process_type = `Lookup`,
inputs = {
`Join Item Master`,
`Calc Planner VRC Groups`
},
multijoins = {
{`Warehouse State`, `Warehouse State` },
{`Vendor Number`, `Vendor Number` },
{`Vendor Report Code Number`, `Vendor Report Code Number` }
}
};
object 'PROC' "State List Calcs" {
//+ coordinatex = `758`,
//+ coordinatey = `233`,
process_type = `calc`,
input = `State List`,
calcs = {
{
name = `State List Filter`,
value = `"Keep"`
}
}
};
object 'PROC' "Join State List" {
//+ coordinatex = `833`,
//+ coordinatey = `8`,
process_type = `Lookup`,
inputs = {
`Join Planner VRC Groups`,
`State List Calcs`
},
multijoins = {
#if VND
{`Vendor Number`, `State` },
#endif
#if !(VND)
{`Warehouse State`, `State` }
#endif
}
};
object 'PROC' "Filter on State List" {
//+ coordinatex = `908`,
//+ coordinatey = `8`,
process_type = `filter`,
input = `Join State List`,
action = `keep`,
filters = {
{
column = `State List Filter`,
values = { `Keep` }
}
}
};
object 'PROC' "Do Calcs" {
//+ coordinatex = `983`,
//+ coordinatey = `8`,
process_type = `calc`,
input = `Filter on State List`,
calcs = {
#if VND
{
column = `Model Path Calc`,
calc_str = `concat("../temp/",Buildorder Name,"-vfquota_planner=",Vendor Number,".txt")`
},
#endif
#if !(VND)
{
name = `Model Path Calc`,
value = `concat("../temp/",City Abbrev,"-vfquota_planner=",Warehouse State,".txt")`
},
#endif
{
name = `Model`,
value = `Model Path Calc`
},
{
name = `Goal Cases`,
value = `Units*if(Goal Type="current",1,0)`
},
{
name = `Original Goal Cases`,
value = `Units*if(Goal Type="original",1,0)`
},
{
name = `Goal 9L`,
value = `Units*Wine Gallons Conversion Factor*3.7853/9*if(Goal Type="current",1,0)`
},
{
name = `Original Goal 9L`,
value = `Units*Wine Gallons Conversion Factor*3.7843/9*if(Goal Type="original",1,0)`
},
{
name = `Goal CE`,
value = `Units*Wine Gallons Conversion Factor/2.25*if(Goal Type="current",1,0)`
},
{
name = `Original Goal CE`,
value = `Units*Wine Gallons Conversion Factor/2.25*if(Goal Type="original",1,0)`
}
}
};
object 'PROC' "Join Vendor Filter" {
//+ coordinatex = `1058`,
//+ coordinatey = `8`,
process_type = `Lookup`,
inputs = {
`Do Calcs`,
`VendorFilterCol Lookup`
},
multijoins = {
{`Vendor Number`, `Vndr` }
}
};
object 'PROC' "Filter Vendor" {
//+ coordinatex = `1133`,
//+ coordinatey = `8`,
input = `Join Vendor Filter`,
process_type = `filter`,
action = `keep`,
filters = {
{
column = `VndrFltrCol`,
values = { `keep` }
}
}
};
object 'PROC' "Join Vendor Time" {
//+ coordinatex = `1208`,
//+ coordinatey = `8`,
process_type = `Lookup`,
inputs = {
`Filter Vendor`,
`Vendor Time`
},
multijoins = {
{`YearMo`, `YearMo` },
{`Vendor Fiscal Month`, `Vendor Fiscal Month` },
{`City Abbrev`, `City Abbrev` }
}
};
object 'PROC' "Vendor Time Filter Calc" {
//+ coordinatex = `1283`,
//+ coordinatey = `8`,
process_type = `calc`,
input = `Join Vendor Time`,
calcs = {
{
name = `Vendor Time Filter Col`,
value = `Vendor TY+Vendor NY`
}
}
};
object 'PROC' "Filter" {
//+ coordinatex = `1358`,
//+ coordinatey = `8`,
input = `Vendor Time Filter Calc`,
process_type = `filter`,
action = `keep`,
filters = {
{
column = `Vendor Time Filter Col`,
values = { `1` }
}
}
};
object 'PROC' "trace-1-TRA" {
//+ coordinatex = `533`,
//+ coordinatey = `8`,
process_type = `trace`,
format = `column_headers`,
input = `VF Quota Calcs`,
qual_str = `Planner Quota Number="209"`,
limit = 1
};
object 'OUTP' "Split" {
//+ coordinatex = `1433`,
//+ coordinatey = `8`,
output_type = `split`,
input = `Filter`,
dictfile1 = `../temp/vfquota.dic`,
filename_column = `Model`,
reportfile = `../temp/vfquota.rep`,
reportfile_type = `column_headers`,
columns = {
`YearMo`,
`Vendor YTD`,
`Vendor TY`,
`Vendor NY`,
`Mo1`,
`Mo2`,
`Mo3`,
`Mo4`,
`Mo5`,
`Mo6`,
`Mo7`,
`Mo8`,
`Mo9`,
`Mo10`,
`Mo11`,
`Mo12`,
`Vendor Fiscal Month`,
`Fiscal Month Count`,
`Warehouse State`,
`Warehouse City`,
`Warehouse Number`,
`Old Warehouse Number`,
`Vendor Name`,
`Vendor Number`,
`Vendor Report Code Number`,
`Vendor Report Code Name`,
`Vendor Report Group Number`,
`Vendor Report Group Desc`,
`Original Goal Cases`,
`Original Goal 9L`,
`Original Goal CE`,
`Goal Cases`,
`Goal 9L`,
`Goal CE`
}
};
//+audits = {
//+`<2014-06-06>, <Bill Lee>: Modified script`,
//+}