[英]ETL data over one column but put partition different column. How can I do it faster?
[英]Create the Mapping & Display Runs For Each Over & I Also Add First Over Runs in the Sum of Second Over Runs & Same for Third Over
源表Cricket_Score
:
過度 | 球 | 跑步 |
---|---|---|
1個 | 1個 | 1個 |
1個 | 2個 | 2個 |
1個 | 3個 | 4個 |
1個 | 4個 | 0 |
1個 | 5個 | 1個 |
1個 | 6個 | 2個 |
2個 | 1個 | 3個 |
2個 | 2個 | 1個 |
2個 | 3個 | 1個 |
2個 | 4個 | 4個 |
2個 | 5個 | 6個 |
2個 | 6個 | 0 |
3個 | 1個 | 2個 |
3個 | 2個 | 1個 |
3個 | 3個 | 1個 |
3個 | 4個 | 6個 |
3個 | 5個 | 0 |
3個 | 6個 | 4個 |
我想要這樣的 output:
過度 | 總運行次數 |
---|---|
1個 | 10 |
2個 | 25 |
3個 | 39 |
描述: -對於第一個球意味着前 6 個球,我想要前 6 個球的總和,即 10。對於第二個 6 個球,我想要前 6 個球的總和 [Over] + 第二個 6 個球,即 25 [10 + 15 = 25] . 對於第三個 6 個球,我想要前 6 個球的總和 [Over] + 第二個 6 個球 + 第三個 ^ 球,即 39 [10 + 15 + 14 = 39]。
注意: - 6 個球意味着一球。
如何在 Informatica 中為這種情況創建映射/我應該使用哪種邏輯?
我會假設您的數據與您在問題中顯示的完全一樣。 如果它在源代碼中不是這樣,那么這將是一個主要問題。 如果它是一個數據未排序的表,那將是一個問題。
解決方案 -
in_balls
in_runs
in_overs
v_cumulative_runs= in_runs+ iif(isnull(v_cumulative_run),0,v_cumulative_run)
out_total_runs=v_cumulative_runs
out_overs=in_overs
in_total_runs
in_out_overs -- group by this port
out_total_runs = max(in_total_runs)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.