用access和excel進行數據分析總結
#數據庫操作(如表的合併,跨表查詢,統計最大最小數值等)適合用access完成
#excel適合處理二維表,對單元格的簡單計算,如下是典型的二維表
600600 | 600601 | 600602 | 600603 | 600604 | |
青島啤酒 | 方正科技 | 廣電電子 | ST興業 | 二紡機 | |
2002-1-4 | 7.46 | 13.02 | 10.04 | 11.08 | 9.27 |
2002-1-7 | 7.31 | 12.9 | 9.92 | 11.1 | 8.85 |
2002-1-8 | 7.3 | 12.99 | 9.95 | 11.11 | 8.73 |
2002-1-9 | 7.19 | 12.92 | 10.04 | 11.44 | 8.25 |
2002-1-10 | 7.35 | 12.94 | 10.09 | 11.95 | 8.4 |
2002-1-11 | 7.28 | 12.66 | 9.77 | 11.68 | 8.04 |
2002-1-14 | 7.08 | 12.01 | 9.5 | 11.54 | 7.73 |
2002-1-15 | 6.99 | 12.02 | 8.95 | 11.34 | 7.67 |
2002-1-16 | 7.15 | 11.99 | 8.93 | 11.15 | 7.88 |
2002-1-17 | 6.91 | 11.58 | 8.4 | 10.04 | 7.19 |
2002-1-18 | 6.9 | 11.37 | 8.2 | 9.34 | 6.9 |
#一般思路: 對於原始的excel表,先利用access的SQL語句進行分組,排序,跨表合併
根據具體要求再利用excel的`公式或VBA完成其他複雜的功能
幾點經驗:
ss中要進行跨表查詢,必須先建立"關係",可使用工具->關係菜單進行設置
2. 常見SQL語句
a)最大最小,排序處理
SELECT AFE_cast_Stkcd, AFE_, Min(AFE__DAYS_ELAPSED) AS RAW_DAYS_ELAPSED之最小值, Max(AFE__DAYS_ELAPSED) AS RAW_DAYS_ELAPSED之最大值
FROM AFE_statv2ACCURACY
GROUP BY AFE_cast_Stkcd, AFE_
ORDER BY AFE_cast_Stkcd, AFE_;
b)刪除數據
DELETE *
FROM AFE_statv2無空項
WHERE AFE_statv2無空項cast_AFE最大值=AFE_statv2無空項cast_AFE最小值
c) 表的連接:
INNER JOIN保留公共數據,LEFT JOIN和RIGHT JOIN分別完整保留左,右表數據,必要時通過DISTINCT參數去除重複的記錄
d)日期函數 Year等
3. excel VBA代碼分析
Public Sub firstVBA()
Dim thisdate As Date
Dim wday As Integer
Dim rno As Integer
Dim stkcd As String
Dim ananm As String
Dim findStk1 As Range
Dim findStk2 As Range
Dim findStk3 As Range
Dim findStk6 As Range
Dim findStk7 As Range
Dim findStk8 As Range
Dim findStk9 As Range
Dim findStk10 As Range
Dim findIndex As Range
Dim findDate As Range
Dim TwoDayB As Integer
Dim TwoDayA As Integer
Dim OneDayB As Integer
Dim OneDayA As Integer
Dim FindCol As Integer
Dim CR_FIVE As Double
Dim CR_THREE As Double
Dim Revp As Double
Dim indexTwoDayB As Integer
Dim indexTwoDayA As Integer
Dim indexOneDayB As Integer
Dim indexOneDayA As Integer
Dim CR_Index_FIVE As Double
Dim CR_Index_THREE As Double
Sheet11是最終存放結果的表,Sheet1-3,6-10存放了各日各股票的價格,sheet5存放上證,深證指數
For rno = 2 To 6864
stkcd = e("A" & rno)e 查找股票代碼
thisdate = e("E" & rno)e 查找日期
Set findStk1 = e("1:1")(stkcd)
Set findStk2 = e("1:1")(stkcd)
Set findStk3 = e("1:1")(stkcd)
Set findStk6 = e("1:1")(stkcd)
Set findStk7 = e("1:1")(stkcd)
Set findStk8 = e("1:1")(stkcd)
Set findStk9 = e("1:1")(stkcd)
Set findStk10 = e("1:1")(stkcd)
查找股票在哪張表中
If Not findStk1 Is Nothing Then
Set findStk = findStk1
Sheets("sz_stk1")ct
ElseIf Not findStk2 Is Nothing Then
Set findStk = findStk2
Sheets("sz_stk2")ct
ElseIf Not findStk3 Is Nothing Then
Set findStk = findStk3
Sheets("sz_stk34")ct
ElseIf Not findStk6 Is Nothing Then
Set findStk = findStk6
Sheets("sh_stk1")ct
ElseIf Not findStk7 Is Nothing Then
Set findStk = findStk7
Sheets("sh_stk2")ct
ElseIf Not findStk8 Is Nothing Then
Set findStk8 = findStk8
Sheets("sh_stk3")ct
ElseIf Not findStk9 Is Nothing Then
Set findStk = findStk9
Sheets("sh_stk4")ct
ElseIf Not findStk10 Is Nothing Then
Set findStk = findStk10
Sheets("sh_stk5")
-
倉庫年終工作總結範文最新
總結是在某一特定時間段對學習和工作生活或其完成情況,包括取得的成績、存在的問題及得到的經驗和教訓加以回顧和分析的書面材料,他能夠提升我們的書面表達能力,讓我們抽出時間寫寫總結吧。你所見過的總結應該是什麼樣的?下面是小編整理的倉庫年終工作總結範文最新...
-
收銀員個人年終工作總結大全
總結是事後對某一階段的學習、工作或其完成情況加以回顧和分析的一種書面材料,它可以使我們更有效率,因此我們要做好歸納,寫好總結。那麼你知道總結如何寫嗎?下面是小編精心整理的收銀員個人年終工作總結大全,希望能夠幫助到大家。收銀員個人年終工作總結大全1有時...
-
發展性閱讀研究工作總結
總結是在某一特定時間段對學習和工作生活或其完成情況,包括取得的成績、存在的問題及得到的經驗和教訓加以回顧和分析的書面材料,它可以促使我們思考,因此十分有必須要寫一份總結哦。你所見過的總結應該是什麼樣的?下面是小編幫大家整理的發展性閱讀研究工作總結,供...
-
幼兒園園本教研總結
總結是指社會團體、企業單位和個人在自身的某一時期、某一項目或某些工作告一段落或者全部完成後進行回顧檢查、分析評價,從而肯定成績,得到經驗,找出差距,得出教訓和一些規律性認識的一種書面材料,通過它可以全面地、系統地瞭解以往的學習和工作情況,是時候寫一份總...
相關文章
- 英語面試問題:Which college classes did you like the
- 數據分析、SPSS、EXCEL、PPT、水晶易表資料彙總
- 數據庫access的優缺點總結
- Eclipse使用EGit怎樣clone遠程倉庫並導入Eclispe?
- clothes什麼意思 clothes+clothing+dress等近義詞用法辨析
- PPT、EXCEL、SPSS、數據分析資料彙總
- ELECTRONICS ENGINEER(Experienced)電子簡歷模板
- system idle process是什麼進程及作用
- ACCESS轉SQLSERVER的數據庫的建議
- ACCESS轉SQL SERVER數據庫的經驗