Bottom - 圖表函數
語法:
Bottom([TOTAL] expr [ , offset [,count ]])
傳回資料類型: 雙值
引數:
引數 | 描述 |
---|---|
|
包含待測量資料的運算式或欄位。 |
offset |
將一個 若指定負值的位移,會讓 Bottom函數的作用相當於包含對應正值位移的 Top 函數。 |
count |
將第三個參數 count指定為大於 1,函數會傳回不是一個,而是 count 的範圍值,目前資料行區段的最後 count 列的每列一個值。 在這種形式下,此函數可作為任何特殊範圍函數的引數。 範圍函數 |
|
如果表格為單一維度或限定詞 TOTAL作為引數,則目前資料行區段一律等於整個資料行。 請參閱: 定義彙總範圍 |
限制:
遞迴呼叫會傳回
範例與結果:
範例: 1
Customer | Sum(Sales) | Bottom(Sum(Sales)) | Sum(Sales) + Bottom(Sum(Sales)) | Bottom offset 3 |
---|---|---|---|---|
2566 | 757 | 3323 | 3105 | |
Astrida | 587 | 757 | 1344 | 1126 |
Betacab | 539 | 757 | 1296 | 1078 |
Canutility | 683 | 757 | 1440 | 1222 |
Divadip | 757 | 757 | 1514 | 1296 |
本範例顯示的表格圖表的表示法中,表格是從維度
資料行
該表格也顯示更複雜的量值:一個是從 Sum(Sales)+Bottom(Sum(Sales))建立,另一個標記為
範例: 2
本範例顯示的表格圖表的表示法中,以下圖表中新增了更多維度:
在第一個表格中,系統是根據 Month評估運算式,而第二個表格中則是根據Product 加以評估。量值 End value包含運算式Bottom(Sum(Sales))。Month的底端列是
Customer | Product | Month | Sum(Sales) | End value |
---|---|---|---|---|
2566 | - | |||
Astrida | AA | Jan | 46 | 22 |
Astrida | AA | Feb | 60 | 22 |
Astrida | AA | Mar | 70 | 22 |
... | ... | ... | ... | ... |
Astrida | AA | Sep | 78 | 22 |
Astrida | AA | Oct | 12 | 22 |
Astrida | AA | Nov | 78 | 22 |
Astrida | AA | Dec | 22 | 22 |
Astrida | BB | Jan | 46 | 22 |
Customer | Product | Month | Sum(Sales) | End value |
---|---|---|---|---|
2566 | - | |||
Astrida | AA | Jan | 46 | 46 |
Astrida | BB | Jan | 46 | 46 |
Astrida | AA | Feb | 60 | 60 |
Astrida | BB | Feb | 60 | 60 |
Astrida | AA | Mar | 70 | 70 |
Astrida | BB | Mar | 70 | 70 |
Astrida | AA | Apr | 13 | 13 |
Astrida | BB | Apr | 13 | 13 |
請參閱
範例: 3 |
結果 | ||
---|---|---|---|
Bottom函數可做為範圍函數的輸入使用。例如︰RangeAvg (Bottom(Sum(Sales),1,3)). |
在 Bottom()函數的引數中, 含有 Customer作為維度的表格可提供 |
||
|
Monthnames:
LOAD * INLINE [
Month, Monthnumber
Jan, 1
Feb, 2
Mar, 3
Apr, 4
May, 5
Jun, 6
Jul, 7
Aug, 8
Sep, 9
Oct, 10
Nov, 11
Dec, 12
];
Sales2013:
crosstable (Month, Sales) LOAD * inline [
Customer|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
Astrida|46|60|70|13|78|20|45|65|78|12|78|22
Betacab|65|56|22|79|12|56|45|24|32|78|55|15
Canutility|77|68|34|91|24|68|57|36|44|90|67|27
Divadip|57|36|44|90|67|27|57|68|47|90|80|94
] (delimiter is '|');
若要取得按正確順序排序的月份,請在建立圖表時前往圖表屬性的 Sort標籤,並勾選 Sort by 下的Expression 核取方塊。在運算式方塊中寫入 Monthnumber。