-
Notifications
You must be signed in to change notification settings - Fork 0
/
Correlacion.iss
100 lines (92 loc) · 3.13 KB
/
Correlacion.iss
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
Sub Main
IgnoreWarning(True)
Call Summarization() 'ED Ventas-2010-L4-Ventas diarias por producto.IMD
Call Summarization1() 'ED Ventas-2010-L4-Ventas diarias por producto.IMD
Call Summarization2() 'ED Ventas-2010-L4-Ventas diarias por producto.IMD
Call AppendDatabase() 'Ventas con cupon 2010-L4.IMD
Call Correlation() 'Completas - Ventas con cupon 2010.IMD
Client.RefreshFileExplorer
End Sub
' Análisis: Resumen
Function Summarization
Set db = Client.OpenDatabase("ED Ventas-2010-L4-Ventas diarias por producto.IMD")
Set task = db.Summarization
task.AddFieldToSummarize "ID_LOCAL"
task.AddFieldToSummarize "AÑO"
task.AddFieldToSummarize "MES"
task.AddFieldToTotal "SUMA_CON_IMP"
task.AddFieldToTotal "VENTAS_CUPON"
dbName = "Ventas con cupon 2010-L4.IMD"
task.OutputDBName = dbName
task.CreatePercentField = FALSE
task.StatisticsToInclude = SM_SUM
task.PerformTask
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
End Function
' Análisis: Resumen
Function Summarization1
Set db = Client.OpenDatabase("ED Ventas-2010-L1-Ventas diarias por producto.IMD")
Set task = db.Summarization
task.AddFieldToSummarize "ID_LOCAL"
task.AddFieldToSummarize "AÑO"
task.AddFieldToSummarize "MES"
task.AddFieldToTotal "SUMA_CON_IMP"
task.AddFieldToTotal "VENTAS_CUPON"
dbName = "Ventas con cupon 2010-L1.IMD"
task.OutputDBName = dbName
task.CreatePercentField = FALSE
task.StatisticsToInclude = SM_SUM
task.PerformTask
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
End Function
' Análisis: Resumen
Function Summarization2
Set db = Client.OpenDatabase("ED Ventas-2010-L3-Ventas diarias por producto.IMD")
Set task = db.Summarization
task.AddFieldToSummarize "ID_LOCAL"
task.AddFieldToSummarize "AÑO"
task.AddFieldToSummarize "MES"
task.AddFieldToTotal "SUMA_CON_IMP"
task.AddFieldToTotal "VENTAS_CUPON"
dbName = "Ventas con cupon 2010-L3.IMD"
task.OutputDBName = dbName
task.CreatePercentField = FALSE
task.StatisticsToInclude = SM_SUM
task.PerformTask
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
End Function
' Archivo: Anexar bases de datos
Function AppendDatabase
Set db = Client.OpenDatabase("Ventas con cupon 2010-L1.IMD")
Set task = db.AppendDatabase
task.AddDatabase "Ventas con cupon 2010-L3.IMD"
task.AddDatabase "Ventas con cupon 2010-L4.IMD"
task.Criteria = " MES >= 9"
dbName = "Completas - Ventas con cupon 2010.IMD"
task.PerformTask dbName, ""
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
End Function
' Análisis: Correlación
Function Correlation
Set db = Client.OpenDatabase("Completas - Ventas con cupon 2010.IMD")
Set task = db.Correlation
task.AddFieldForCorrelation "SUMA_CON_IMP_SUMA"
task.AddFieldForCorrelation "VENTAS_CUPON_SUMA"
task.AuditUnitField = "ID_LOCAL"
resultName = db.UniqueResultName("Correlación de ventas y cupones 2010")
task.ResultName = resultName
dbName = "Correlación de ventas y cupones 2010.IMD"
task.OutputDBName = dbName
task.PerformTask
Set task = Nothing
Set db = Nothing
Client.OpenDatabase(dbName)
End Function