DBA Data[Home] [Help]

APPS.BSC_UPDATE_COLOR dependencies on BSC_SYS_KPI_COLORS

Line 448: UPDATE bsc_sys_kpi_colors

444: CLOSE l_mcc_actual_plan_cursor;
445:
446: IF l_mcc_real IS NOT NULL THEN
447:
448: UPDATE bsc_sys_kpi_colors
449: SET actual_data = l_mcc_real, budget_data = l_mcc_plan
450: WHERE tab_id = p_tab_id
451: AND indicator = p_objective_id
452: AND kpi_measure_id = p_kpi_measure_id

Line 597: h_match_sql := ' SELECT count(*) FROM bsc_sys_kpi_colors '||

593: OPEN h_actual_value_cursor FOR h_actualvalue_sql USING h_trend_period, h_trend_color;-- USING h_key1,h_key2,h_key3,h_key4,h_key5,h_key6,h_key7,h_key8,h_trend_period, h_trend_color;
594: FETCH h_actual_value_cursor INTO h_trend_vreal, h_trend_keys;
595: WHILE h_actual_value_cursor%FOUND LOOP
596: l_count := 0;
597: h_match_sql := ' SELECT count(*) FROM bsc_sys_kpi_colors '||
598: ' WHERE tab_id=:1 AND indicator=:2 AND kpi_measure_id=:3 '||
599: ' AND PERIOD_ID=:4 AND KPI_COLOR=:5 '||
600: ' AND ACTUAL_DATA=:6 '||
601: ' AND ('||h_key1||'=0 OR nvl(DIM_LEVEL1,0)='||h_key1||')'||

Line 660: UPDATE bsc_sys_kpi_colors

656: IF (l_key_tbl.COUNT > 0) THEN
657: FOR i in l_key_tbl.FIRST..l_key_tbl.LAST LOOP
658: l_key_rec := l_key_tbl(i);
659:
660: UPDATE bsc_sys_kpi_colors
661: SET kpi_trend = l_key_rec.trend
662: WHERE tab_id = p_tab_id
663: AND indicator = p_indic_code
664: AND kpi_measure_id = p_kpi_measure_id

Line 1256: -- Make the list of keys to insert into BSC_SYS_KPI_COLORS (h_lst_keys_insert)

1252: ) THEN
1253: RAISE e_unexpected_error;
1254: END IF;
1255:
1256: -- Make the list of keys to insert into BSC_SYS_KPI_COLORS (h_lst_keys_insert)
1257: -- Example: '0, BRANCH_CODE, 0, 0, 0, 0, 0, 0' (8 dim levels in the table)
1258: h_lst_keys_insert := NULL;
1259: h_i := 0;
1260: h_key_index := 1;

Line 1298: -- Otherwise we are ready to insert the colors directly in BSC_SYS_KPI_COLORS

1294: END LOOP;
1295:
1296:
1297: -- If the indicator enter in comparison we need to calculate the minimum common color
1298: -- Otherwise we are ready to insert the colors directly in BSC_SYS_KPI_COLORS
1299: IF (x_comp_level_pk_col IS NOT NULL) AND (x_color_by_total = 0) AND
1300: (NOT x_indic_pl_flag) AND (NOT x_indic_initiatives_flag) THEN
1301: -- The indicator enter in comparison.
1302: -- Note: I exclude the PL indicator because this indicator has x_comp_level_pk_col = 'ACCOUNT_CODE'

Line 1306: -- directly in BSC_SYS_KPI_COLORS in the last dimension level.

1302: -- Note: I exclude the PL indicator because this indicator has x_comp_level_pk_col = 'ACCOUNT_CODE'
1303: -- and x_color_by_total = 0, but the color of a PL indicator is based on the profit account.
1304: -- Note: I exclude the Initiatives indicator because this indicator has x_comp_level_pk_col = 'PROJECT_CODE'
1305: -- and x_color_by_total = 0 but we dont calculte the minimum color. Instead we put the color of each project
1306: -- directly in BSC_SYS_KPI_COLORS in the last dimension level.
1307:
1308: h_lst_select := BSC_UPDATE_UTIL.Make_Lst_Fixed_Column('KEY', x_num_families);
1309: IF h_lst_select IS NOT NULL THEN
1310: h_lst_select := h_lst_select||', ';

Line 1319: -- We are ready to insert the colors directly in BSC_SYS_KPI_COLORS

1315: ' FROM BSC_TMP_COLORS TEM_C, BSC_SYS_COLORS_B COL_B'||
1316: ' WHERE TEM_C.COLOR = COL_B.COLOR_ID'||
1317: ' GROUP BY '||h_lst_select||'PERIOD';
1318:
1319: -- We are ready to insert the colors directly in BSC_SYS_KPI_COLORS
1320: h_sql := 'INSERT INTO BSC_SYS_KPI_COLORS (TAB_ID, INDICATOR, KPI_MEASURE_ID, DIM_LEVEL1, DIM_LEVEL2,'||
1321: ' DIM_LEVEL3, DIM_LEVEL4, DIM_LEVEL5, DIM_LEVEL6, DIM_LEVEL7, DIM_LEVEL8,'||
1322: ' PERIOD_ID, KPI_COLOR, USER_COLOR)'||
1323: ' SELECT :1, :2, :3, '||h_lst_keys_insert||'PERIOD,'|| ' COL_B.COLOR_ID, COL_B.COLOR_ID ' ||

Line 1320: h_sql := 'INSERT INTO BSC_SYS_KPI_COLORS (TAB_ID, INDICATOR, KPI_MEASURE_ID, DIM_LEVEL1, DIM_LEVEL2,'||

1316: ' WHERE TEM_C.COLOR = COL_B.COLOR_ID'||
1317: ' GROUP BY '||h_lst_select||'PERIOD';
1318:
1319: -- We are ready to insert the colors directly in BSC_SYS_KPI_COLORS
1320: h_sql := 'INSERT INTO BSC_SYS_KPI_COLORS (TAB_ID, INDICATOR, KPI_MEASURE_ID, DIM_LEVEL1, DIM_LEVEL2,'||
1321: ' DIM_LEVEL3, DIM_LEVEL4, DIM_LEVEL5, DIM_LEVEL6, DIM_LEVEL7, DIM_LEVEL8,'||
1322: ' PERIOD_ID, KPI_COLOR, USER_COLOR)'||
1323: ' SELECT :1, :2, :3, '||h_lst_keys_insert||'PERIOD,'|| ' COL_B.COLOR_ID, COL_B.COLOR_ID ' ||
1324: ' FROM ('||h_sql_mcc||') BSC_TMP_COLORS_MCC, BSC_SYS_COLORS_B COL_B'||

Line 1356: -- The indicator doesnt enter in comparison. We are ready to insert the colors directly in BSC_SYS_KPI_COLORS

1352:
1353: COMMIT;
1354: ELSE
1355:
1356: -- The indicator doesnt enter in comparison. We are ready to insert the colors directly in BSC_SYS_KPI_COLORS
1357: h_sql := 'INSERT /*+ append */ INTO BSC_SYS_KPI_COLORS (TAB_ID, INDICATOR, KPI_MEASURE_ID, DIM_LEVEL1, DIM_LEVEL2,'||
1358: ' DIM_LEVEL3, DIM_LEVEL4, DIM_LEVEL5, DIM_LEVEL6, DIM_LEVEL7, DIM_LEVEL8,'||
1359: ' PERIOD_ID, KPI_COLOR, USER_COLOR, ACTUAL_DATA, BUDGET_DATA)'||
1360: ' SELECT :1, :2, :3, '||h_lst_keys_insert||'PERIOD,'||

Line 1357: h_sql := 'INSERT /*+ append */ INTO BSC_SYS_KPI_COLORS (TAB_ID, INDICATOR, KPI_MEASURE_ID, DIM_LEVEL1, DIM_LEVEL2,'||

1353: COMMIT;
1354: ELSE
1355:
1356: -- The indicator doesnt enter in comparison. We are ready to insert the colors directly in BSC_SYS_KPI_COLORS
1357: h_sql := 'INSERT /*+ append */ INTO BSC_SYS_KPI_COLORS (TAB_ID, INDICATOR, KPI_MEASURE_ID, DIM_LEVEL1, DIM_LEVEL2,'||
1358: ' DIM_LEVEL3, DIM_LEVEL4, DIM_LEVEL5, DIM_LEVEL6, DIM_LEVEL7, DIM_LEVEL8,'||
1359: ' PERIOD_ID, KPI_COLOR, USER_COLOR, ACTUAL_DATA, BUDGET_DATA)'||
1360: ' SELECT :1, :2, :3, '||h_lst_keys_insert||'PERIOD,'||
1361: ' COLOR, COLOR, VREAL, VPLAN'||

Line 1417: h_sql := 'UPDATE BSC_SYS_KPI_COLORS'||

1413: RAISE e_unexpected_error;
1414: END IF;
1415: CLOSE h_cursor;
1416:
1417: h_sql := 'UPDATE BSC_SYS_KPI_COLORS'||
1418: ' SET DIM_LEVEL'||(h_dim_level_index_parent + 1)||' = ('||
1419: ' SELECT '||h_level_pk_col_parent||
1420: ' FROM '||h_level_table_name_child||
1421: ' WHERE BSC_SYS_KPI_COLORS.DIM_LEVEL'||(h_dim_level_index_child + 1)||

Line 1421: ' WHERE BSC_SYS_KPI_COLORS.DIM_LEVEL'||(h_dim_level_index_child + 1)||

1417: h_sql := 'UPDATE BSC_SYS_KPI_COLORS'||
1418: ' SET DIM_LEVEL'||(h_dim_level_index_parent + 1)||' = ('||
1419: ' SELECT '||h_level_pk_col_parent||
1420: ' FROM '||h_level_table_name_child||
1421: ' WHERE BSC_SYS_KPI_COLORS.DIM_LEVEL'||(h_dim_level_index_child + 1)||
1422: ' = '||h_level_table_name_child||'.CODE'||
1423: ')'||
1424: ' WHERE TAB_ID = :1 AND '||
1425: ' INDICATOR = :2 AND '||

Line 1907: DELETE FROM bsc_sys_kpi_colors

1903: END IF;
1904: CLOSE c_objective_color_props;
1905:
1906: -- Delete the colors of the indicator for this tab
1907: DELETE FROM bsc_sys_kpi_colors
1908: WHERE tab_id = l_objective_color_props.tab_id AND indicator = x_indic_code;
1909: DELETE FROM bsc_sys_objective_colors
1910: WHERE tab_id = l_objective_color_props.tab_id AND indicator = x_indic_code;
1911: COMMIT;

Line 2250: -- Key columns are for common dimensions. Like BSC_SYS_KPI_COLORS I will

2246: END IF;
2247:
2248:
2249: -- Create temporal table BSC_TMP_DATA_COLOR
2250: -- Key columns are for common dimensions. Like BSC_SYS_KPI_COLORS I will
2251: -- create 8 key columns
2252: h_table_name := 'BSC_TMP_DATA_COLOR';
2253: h_table_columns.delete;
2254: h_num_columns := 0;

Line 2284: -- Key columns are for common dimensions. Like BSC_SYS_KPI_COLORS I will

2280: RAISE e_unexpected_error;
2281: END IF;
2282:
2283: -- Create temporal table BSC_TMP_COLORS
2284: -- Key columns are for common dimensions. Like BSC_SYS_KPI_COLORS I will
2285: -- create 8 key columns
2286: h_table_name := 'BSC_TMP_COLORS';
2287: h_table_columns.delete;
2288: h_num_columns := 0;

Line 3033: /* Once the KPI colors are calculated and stored in BSC_SYS_KPI_COLORS,

3029:
3030: END Get_KPI_Property_Value;
3031:
3032:
3033: /* Once the KPI colors are calculated and stored in BSC_SYS_KPI_COLORS,
3034: * this API will calculate the Objective color based on the rollup type.
3035: * The objective color will be stored in BSC_SYS_OBJECTIVE_COLORS.
3036: * Rollup type can be one of: BEST, WORST, MOST_FREQUENT, WEIGHTED_AVERAGE,
3037: * DEFAULT_KPI. For Simulation Objective, the color will be based on the

Line 3104: FROM bsc_sys_kpi_colors

3100: SELECT DISTINCT
3101: dim_level1 || dim_level2 || dim_level3 || dim_level4 || dim_level5 || dim_level6 || dim_level7 || dim_level8 dim_comb,
3102: dim_level1, dim_level2, dim_level3, dim_level4, dim_level5, dim_level6, dim_level7, dim_level8,
3103: period_id, actual_data, budget_data, kpi_color, kpi_trend
3104: FROM bsc_sys_kpi_colors
3105: WHERE indicator = x_indicator
3106: AND tab_id = x_tab_id
3107: AND kpi_measure_id = x_measure_id
3108: ORDER BY dim_comb,period_id;

Line 3184: h_sql := 'UPDATE bsc_sys_kpi_colors'||

3180: END IF;
3181:
3182: IF (NOT l_comparison) THEN
3183:
3184: h_sql := 'UPDATE bsc_sys_kpi_colors'||
3185: ' SET kpi_trend = '||l_trendflag||
3186: ' WHERE indicator =:1 '||
3187: ' AND tab_id = :2 '||
3188: ' AND kpi_measure_id = :3 '||