数据挖掘实验二结果(构建cube的三个维度,即三个txt,然后做各种查询)C++实现(代码调试环境为Windows下的CLion使用WSL的Linux)

构建cube的三个维度,查询三家店七天四物的销售总额

C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
三个Cube.txt未全部构造完,请继续执行construct the cube
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
construct the cube
请输入获取源数据的txt文件的文件名(fl_1019.txt、fl_1020.txt、fl_1021.txt):“xxx.txt” 
fl_1019.txt
获取数据的文件名为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/fl_1019.txt
请输入存放cube数据的的txt文件的文件名(cube_1019.txt,cube_1020.txt,cube_1021.txt):“xxx.txt” 
cube_1019.txt
存放数据文件的绝对路径为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/cube_1019.txt
先读出第一行表头如下:
流水号	门店号	日期	购买商品序号	商品id	购买数量	商品单价	
构建该cube的源数据文件为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/fl_1019.txt,其共有7693行数据记录
/mnt/e/CODING__ALAN_CF/DataMining/Test2/cube_1019.txt的cube构建完毕
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
construct the cube
请输入获取源数据的txt文件的文件名(fl_1019.txt、fl_1020.txt、fl_1021.txt):“xxx.txt” 
fl_1020.txt
获取数据的文件名为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/fl_1020.txt
请输入存放cube数据的的txt文件的文件名(cube_1019.txt,cube_1020.txt,cube_1021.txt):“xxx.txt” 
cube_1020.txt
存放数据文件的绝对路径为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/cube_1020.txt
先读出第一行表头如下:
流水号	门店号	日期	购买商品序号	商品id	购买数量	商品单价	
构建该cube的源数据文件为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/fl_1020.txt,其共有9896行数据记录
/mnt/e/CODING__ALAN_CF/DataMining/Test2/cube_1020.txt的cube构建完毕
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
construct the cube
请输入获取源数据的txt文件的文件名(fl_1019.txt、fl_1020.txt、fl_1021.txt):“xxx.txt” 
fl_1021.txt
获取数据的文件名为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/fl_1021.txt
请输入存放cube数据的的txt文件的文件名(cube_1019.txt,cube_1020.txt,cube_1021.txt):“xxx.txt” 
cube_1021.txt
存放数据文件的绝对路径为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/cube_1021.txt
先读出第一行表头如下:
流水号	门店号	日期	购买商品序号	商品id	购买数量	商品单价	
构建该cube的源数据文件为:/mnt/e/CODING__ALAN_CF/DataMining/Test2/fl_1021.txt,其共有9827行数据记录
/mnt/e/CODING__ALAN_CF/DataMining/Test2/cube_1021.txt的cube构建完毕
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
Now query
1019、1020、1021三家店,在13-19七天的总销售额为:4875.83
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

构建好的三个cube_txt如下:

第八行和第五列为该列/行的总和,第八行第五列的数据为第八行总和与第五列总和的平均数(double类型计算有误差,这取平均数)

cube_1019.txt
1001010020面制品 	10030米和粉 	10088其他粮油 	
35.10    	4.90    	3.80    	0.00    	43.80    	
60.00    	58.20    	17.90    	14.17    	150.27    	
34.60    	50.80    	23.80    	34.48    	143.68    	
56.30    	5.70    	3.30    	15.88    	81.18    	
45.20    	3.60    	2.40    	0.00    	51.20    	
0.00    	0.00    	0.00    	0.00    	0.00    	
38.00    	23.60    	25.80    	0.00    	87.40    	
269.20    	146.80    	77.00    	64.54    	557.54  
cube_1020.txt
1001010020面制品 	10030米和粉 	10088其他粮油 	
313.40    	114.50    	147.90    	38.50    	614.30    	
12.00    	5.60    	10.70    	0.00    	28.30    	
164.40    	48.00    	210.20    	43.80    	466.40    	
184.50    	138.30    	41.60    	14.60    	379.00    	
172.30    	67.80    	169.30    	20.00    	429.40    	
0.00    	0.00    	2.00    	0.00    	2.00    	
158.00    	104.10    	161.70    	14.60    	438.40    	
1004.60    	478.30    	743.40    	131.50    	2357.80    	
cube_1021.txt
1001010020面制品 	10030米和粉 	10088其他粮油 	
100.50    	71.04    	186.91    	0.00    	358.45    	
110.59    	243.06    	121.04    	9.28    	483.98    	
84.15    	100.78    	38.22    	1.67    	224.83    	
108.24    	54.34    	133.31    	7.93    	303.82    	
58.57    	66.70    	33.39    	2.57    	161.23    	
89.13    	156.19    	32.28    	2.58    	280.18    	
35.92    	78.15    	33.91    	0.00    	147.99    	
587.11    	770.28    	579.06    	24.04    	1960.49    

查询:输入第一个参数为店名

只根据这一个店名作参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
1019
Now select the second parameter of query Or Now query
1、Select the date: 13、14、15、16、17、18、19
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
Now query
1019这家店13-19七天里商品10010、10020、10030、10088的销售总额为:557.54
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第二个参数为日期
根据第一个参数店名和第二个参数日期查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
1020
Now select the second parameter of query Or Now query
1、Select the date: 13、14、15、16、17、18、19
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
16
Now select the third parameter of query Or Now query
1、Select the species: 10010、10020、10030、10088
2、Not select, Based on the Current situation And Begin query : Now query
3、Give Up And Exit please input: exit
Now query
在16这天,1020这家店的10010、10020、10030、10088四种商品的销售总额为:379.00
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第三个参数为商品种类,三个参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
1021
Now select the second parameter of query Or Now query
1、Select the date: 13、14、15、16、17、18、19
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
18
Now select the third parameter of query Or Now query
1、Select the species: 10010、10020、10030、10088
2、Not select, Based on the Current situation And Begin query : Now query
3、Give Up And Exit please input: exit
10030
1、All parameters are selected, Now query ?
2、Give Up And Exit please input: exit
Now query
商品:10030在1021这家店,在18这天的销售总额为:32.28
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第二个参数为商品种类
根据第一个参数店名和第二个参数商品种类查询:
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
1020
Now select the second parameter of query Or Now query
1、Select the date: 13、14、15、16、17、18、19
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
10088
Now select the third parameter of query Or Now query
1、Select the date,please input: 13、14、15、16、17、18、19
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
Now query
商品:10088在1020这家店,从13-19七天的销售总额为:131.50
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第三个参数日期,三个参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
1020
Now select the second parameter of query Or Now query
1、Select the date: 13、14、15、16、17、18、19
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
10030
Now select the third parameter of query Or Now query
1、Select the date,please input: 13、14、15、16、17、18、19
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
15
1、Not select, Based on the Current situation And Begin query please input: Now query
2、Give Up And Exit please input: exit
Now query
商品:10030在1020这家店,在15这天的销售总额为:210.20
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

查询:输入第一个参数为日期

只根据这一个日期作参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
17
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
Now query
在17这天,1019、1020、1021三家店的10010、10020、10030、10088四种商品的销售总额为:641.83
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第二个参数为店名
根据第一个参数日期和第二个参数店名查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
16
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
1021
Now select the third parameter of query Or Now query
1、Select the species,please input: 10010、10020、10030、10088
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
Now query
在16这天,1021这家店的10010、10020、10030、10088四种商品的销售总额为:303.82
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第三个参数为商品种类,三个参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
14
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
1020
Now select the third parameter of query Or Now query
1、Select the species,please input: 10010、10020、10030、10088
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
10010
1、All parameters are selected, Now query ?
2、Give Up And Exit please input: exit
Now query
商品:10010在1020这家店,在14这天的销售总额为:12.00
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第二个参数为商品种类
根据第一个参数日期和第二个参数商品种类查询:
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
15
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
10030
Now select the third parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
Now query
商品:10030在1019、1020、1021三家店,15日这天的销售总额为:272.22
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第三个参数店名,三个参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
18
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the species,please input: 10010、10020、10030、10088
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
10020
Now select the third parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
1021
1、All parameters are selected, Now query ?
2、Give Up And Exit please input: exit
Now query
商品:10020在1021这家店,在18这天的销售总额为:156.19
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

查询:输入第一个参数为商品种类

只根据这一个商品种类作参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
10088
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
Now query
商品:10088在1019、1020、1021三家店,从13-19七天的销售总额为:220.08
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0
输入第二个参数为店名
根据第一个参数商品种类和第二个参数店名查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
10020
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
1021
Now select the third parameter of query Or Now query
1、Select the date,please input: 13、14、15、16、17、18、19
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
Now query
商品:10020在1021这家店,从13-19七天的销售总额为:770.28
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0
输入第三个参数为日期,三个参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
10030
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
1021
Now select the third parameter of query Or Now query
1、Select the date,please input: 13、14、15、16、17、18、19
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
19
1、All parameters are selected, Now query ?
2、Give Up And Exit please input: exit
Now query
商品:10030在1021这家店,在19这天的销售总额为:33.91
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第二个参数为日期
根据第一个参数商品种类和第二个参数日期查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
10010
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
19
Now select the third parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
Now query
商品:10010在1019、1020、1021三家店,19日这天的销售总额为:231.92
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

输入第三个参数为店名,三个参数查询
C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/e/CODING__ALAN_CF/DataMining/Test2 && /mnt/e/CODING__ALAN_CF/cmake-build-debug/test2"
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
query from cube
Now select the first parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Select the species,please input: 10010、10020、10030、10088
4、Not select, Based on the Current situation And Begin query please input: Now query
5、Give Up And Exit please input: exit
10020
Now select the second parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Select the date,please input: 13、14、15、16、17、18、19
3、Not select, Based on the Current situation And Begin query please input: Now query
4、Give Up And Exit please input: exit
19
Now select the third parameter of query Or Now query
1、Select the market,please input: 1019、1020、1021
2、Not select, Based on the Current situation And Begin query please input: Now query
3、Give Up And Exit please input: exit
1019
1、All parameters are selected, Now query ?
2、Give Up And Exit please input: exit
Now query
商品:10020在1019这家店,在19这天的销售总额为:23.60
******************************选择操作**********************************
**************************construct the cube***************************
**************************query from cube******************************
********************************exit************************************
exit

Process finished with exit code 0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
查询SAP BW Cube中的维度数据,你可以使用BAPI_MDPROVIDER_GET_DIMENSIONS函数来获取维度列表,然后使用BAPI_DIMENSION_GET_TEXTS函数获取维度的文本值。以下是一个示例代码,演示了如何查询SAP BW Cube中的维度数据: 首先,确保你已经安装了SAP Java Connector并将其添加到你的Java项目中。 然后,导入所需的类和包: ```java import com.sap.conn.jco.*; ``` 接下来,创建一个SAP连接: ```java JCoDestination destination = JCoDestinationManager.getDestination("YOUR_DESTINATION_NAME"); JCoRepository repository = destination.getRepository(); JCoFunction function = repository.getFunction("BAPI_MDPROVIDER_GET_DIMENSIONS"); ``` 请将 "YOUR_DESTINATION_NAME" 替换为你的SAP连接配置信息。 然后,设置输入参数并执行函数: ```java JCoParameterList inputParams = function.getImportParameterList(); inputParams.setValue("INFOCUBE", "YOUR_CUBE_NAME"); function.execute(destination); ``` 将 "YOUR_CUBE_NAME" 替换为你要查询Cube名字。 接下来,处理结果并输出维度数据: ```java JCoParameterList outputParams = function.getTableParameterList().getTable("DIMENSIONS"); for (int i = 0; i < outputParams.getNumRows(); i++) { outputParams.setRow(i); String dimensionName = outputParams.getString("DIMENSION"); System.out.println("Dimension Name: " + dimensionName); // 获取维度的文本值 JCoFunction getTextsFunction = repository.getFunction("BAPI_DIMENSION_GET_TEXTS"); JCoParameterList getTextsInputParams = getTextsFunction.getImportParameterList(); getTextsInputParams.setValue("DIMENSION", dimensionName); getTextsFunction.execute(destination); JCoTable textsTable = getTextsFunction.getTableParameterList().getTable("DIMENSION_TEXTS"); for (int j = 0; j < textsTable.getNumRows(); j++) { textsTable.setRow(j); String language = textsTable.getString("LANGU_ISO"); String text = textsTable.getString("DESCRIPTION"); System.out.println("Language: " + language); System.out.println("Text: " + text); } } ``` 这里的示例代码首先获取维度列表,然后针对每个维度使用BAPI_DIMENSION_GET_TEXTS函数获取维度的文本值。你可以根据需要进一步处理返回的数据。 请注意,你还需要配置SAP连接的相关信息,如SAP系统的主机名、端口号、用户名和密码等。这些配置信息可以在SAP JCo的配置文件中进行设置。 这是一个简单的示例代码,希望能帮助到你。请确保正确配置和引入相关的依赖项,并根据你的具体情况进行适当调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值