20: l_district_leaf_node varchar2(1);
21:
22: begin
23:
24: if nvl(isc_fs_rpt_util_pkg.get_parameter_value
25: ( p_param
26: , isc_fs_rpt_util_pkg.G_CATEGORY
27: ),'All') = 'All' then
28: l_top_node := 'Y';
22: begin
23:
24: if nvl(isc_fs_rpt_util_pkg.get_parameter_value
25: ( p_param
26: , isc_fs_rpt_util_pkg.G_CATEGORY
27: ),'All') = 'All' then
28: l_top_node := 'Y';
29: else
30: l_top_node := 'N';
31: end if;
32:
33: if p_report_type = 'MTTR' then
34:
35: l_district_leaf_node := isc_fs_rpt_util_pkg.is_district_leaf_node
36: ( p_param );
37:
38: isc_fs_rpt_util_pkg.bind_group_id
39: ( p_dim_bmap
34:
35: l_district_leaf_node := isc_fs_rpt_util_pkg.is_district_leaf_node
36: ( p_param );
37:
38: isc_fs_rpt_util_pkg.bind_group_id
39: ( p_dim_bmap
40: , p_custom_output
41: , isc_fs_rpt_util_pkg.G_CATEGORY
42: , isc_fs_rpt_util_pkg.G_PRODUCT
37:
38: isc_fs_rpt_util_pkg.bind_group_id
39: ( p_dim_bmap
40: , p_custom_output
41: , isc_fs_rpt_util_pkg.G_CATEGORY
42: , isc_fs_rpt_util_pkg.G_PRODUCT
43: , isc_fs_rpt_util_pkg.G_CUSTOMER
44: );
45:
38: isc_fs_rpt_util_pkg.bind_group_id
39: ( p_dim_bmap
40: , p_custom_output
41: , isc_fs_rpt_util_pkg.G_CATEGORY
42: , isc_fs_rpt_util_pkg.G_PRODUCT
43: , isc_fs_rpt_util_pkg.G_CUSTOMER
44: );
45:
46: if bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CATEGORY_BMAP) = isc_fs_rpt_util_pkg.G_CATEGORY_BMAP then
39: ( p_dim_bmap
40: , p_custom_output
41: , isc_fs_rpt_util_pkg.G_CATEGORY
42: , isc_fs_rpt_util_pkg.G_PRODUCT
43: , isc_fs_rpt_util_pkg.G_CUSTOMER
44: );
45:
46: if bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CATEGORY_BMAP) = isc_fs_rpt_util_pkg.G_CATEGORY_BMAP then
47:
42: , isc_fs_rpt_util_pkg.G_PRODUCT
43: , isc_fs_rpt_util_pkg.G_CUSTOMER
44: );
45:
46: if bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CATEGORY_BMAP) = isc_fs_rpt_util_pkg.G_CATEGORY_BMAP then
47:
48: return '(
49: select
50: v.top_node_flag vbh_top_node_flag
98: when l_top_node = 'Y' then '
99: and v.top_node_flag = ''Y''' end || '
100: )';
101:
102: elsif bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_PRODUCT_BMAP) = isc_fs_rpt_util_pkg.G_PRODUCT_BMAP or
103: bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CUSTOMER_BMAP) = isc_fs_rpt_util_pkg.G_CUSTOMER_BMAP or
104: bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_SEVERITY_BMAP) = isc_fs_rpt_util_pkg.G_SEVERITY_BMAP then
105:
106: return '(
99: and v.top_node_flag = ''Y''' end || '
100: )';
101:
102: elsif bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_PRODUCT_BMAP) = isc_fs_rpt_util_pkg.G_PRODUCT_BMAP or
103: bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CUSTOMER_BMAP) = isc_fs_rpt_util_pkg.G_CUSTOMER_BMAP or
104: bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_SEVERITY_BMAP) = isc_fs_rpt_util_pkg.G_SEVERITY_BMAP then
105:
106: return '(
107: select
100: )';
101:
102: elsif bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_PRODUCT_BMAP) = isc_fs_rpt_util_pkg.G_PRODUCT_BMAP or
103: bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CUSTOMER_BMAP) = isc_fs_rpt_util_pkg.G_CUSTOMER_BMAP or
104: bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_SEVERITY_BMAP) = isc_fs_rpt_util_pkg.G_SEVERITY_BMAP then
105:
106: return '(
107: select
108: f.time_id
173: end if;
174:
175: elsif p_report_type = 'MTTR_DETAIL' then
176:
177: if isc_fs_rpt_util_pkg.get_parameter_id
178: ( p_param
179: , isc_fs_rpt_util_pkg.G_DISTRICT
180: ) like '%.%' then
181: l_resource := 'Y';
175: elsif p_report_type = 'MTTR_DETAIL' then
176:
177: if isc_fs_rpt_util_pkg.get_parameter_id
178: ( p_param
179: , isc_fs_rpt_util_pkg.G_DISTRICT
180: ) like '%.%' then
181: l_resource := 'Y';
182: else
183: l_resource := 'N';
204: , r.time_to_resolution*24 time_to_resolve
205: , r.report_date
206: , nvl(s.master_id,s.id) product_id ' ||
207: case
208: when bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CATEGORY_BMAP) = isc_fs_rpt_util_pkg.G_CATEGORY_BMAP then
209: '
210: , v.top_node_flag vbh_top_node_flag
211: , v.parent_id vbh_parent_category_id
212: , v.imm_child_id vbh_child_category_id'
216: isc_fs_tasks_f t
217: , biv_dbi_resolution_sum_f r
218: , eni_oltp_item_star s' ||
219: case
220: when bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CATEGORY_BMAP) = isc_fs_rpt_util_pkg.G_CATEGORY_BMAP then
221: '
222: , eni_denorm_hierarchies v
223: , mtl_default_category_sets m'
224: end ||
232: and r.time_to_resolution is not null
233: and r.inventory_item_id = s.inventory_item_id
234: and r.inv_organization_id = s.organization_id' ||
235: case
236: when bitand(p_dim_bmap,isc_fs_rpt_util_pkg.G_CATEGORY_BMAP) = isc_fs_rpt_util_pkg.G_CATEGORY_BMAP then
237: '
238: and m.functional_area_id = 11
239: and v.object_id = m.category_set_id
240: and v.dbi_flag = ''Y''
261: , x_custom_output out nocopy bis_query_attributes_tbl
262: )
263: is
264:
265: l_dimension_tbl isc_fs_rpt_util_pkg.t_dimension_tbl;
266: l_dim_filter_map poa_dbi_util_pkg.poa_dbi_dim_map;
267: l_custom_output bis_query_attributes_tbl;
268: l_curr_suffix varchar2(3);
269: l_where_clause varchar2(10000);
282: l_to_date_type varchar2(200);
283:
284: begin
285:
286: isc_fs_rpt_util_pkg.register_dimension_levels
287: ( l_dimension_tbl
288: , l_dim_filter_map
289: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
290: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
285:
286: isc_fs_rpt_util_pkg.register_dimension_levels
287: ( l_dimension_tbl
288: , l_dim_filter_map
289: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
290: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
291: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
292: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
293: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
286: isc_fs_rpt_util_pkg.register_dimension_levels
287: ( l_dimension_tbl
288: , l_dim_filter_map
289: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
290: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
291: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
292: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
293: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
294: );
287: ( l_dimension_tbl
288: , l_dim_filter_map
289: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
290: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
291: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
292: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
293: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
294: );
295:
288: , l_dim_filter_map
289: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
290: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
291: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
292: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
293: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
294: );
295:
296: isc_fs_rpt_util_pkg.process_parameters
289: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
290: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
291: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
292: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
293: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
294: );
295:
296: isc_fs_rpt_util_pkg.process_parameters
297: ( p_param => p_param
292: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
293: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
294: );
295:
296: isc_fs_rpt_util_pkg.process_parameters
297: ( p_param => p_param
298: , p_dimension_tbl => l_dimension_tbl
299: , p_dim_filter_map => l_dim_filter_map
300: , p_trend => 'N'
313: else
314: l_to_date_type := 'RLX';
315: end if;
316:
317: l_view_by := isc_fs_rpt_util_pkg.get_parameter_value
318: ( p_param
319: , 'VIEW_BY'
320: );
321:
318: ( p_param
319: , 'VIEW_BY'
320: );
321:
322: if l_view_by = isc_fs_rpt_util_pkg.G_PRODUCT then
323: l_product := 'v4.description ISC_ATTRIBUTE_2';
324: else
325: l_product := 'null ISC_ATTRIBUTE_2';
326: end if;
391: , ISC_MEASURE_22 ISC_MEASURE_27
392: , ISC_MEASURE_22 ISC_MEASURE_28
393: , ISC_MEASURE_23 ISC_MEASURE_29
394: , ' || l_product || '
395: , ' || isc_fs_rpt_util_pkg.get_district_drill_down
396: ( l_view_by
397: , g_task_rep_func
398: , 'ISC_ATTRIBUTE_3' ) || '
399: , ' || isc_fs_rpt_util_pkg.get_category_drill_down
395: , ' || isc_fs_rpt_util_pkg.get_district_drill_down
396: ( l_view_by
397: , g_task_rep_func
398: , 'ISC_ATTRIBUTE_3' ) || '
399: , ' || isc_fs_rpt_util_pkg.get_category_drill_down
400: ( l_view_by
401: , g_task_rep_func
402: , 'ISC_ATTRIBUTE_4' ) || '
403: , ' || isc_fs_rpt_util_pkg.get_bucket_drill_down
399: , ' || isc_fs_rpt_util_pkg.get_category_drill_down
400: ( l_view_by
401: , g_task_rep_func
402: , 'ISC_ATTRIBUTE_4' ) || '
403: , ' || isc_fs_rpt_util_pkg.get_bucket_drill_down
404: ( p_bucket_rec => l_bucket_rec
405: , p_view_by => l_view_by
406: , p_function_name => case
407: when l_view_by in ( isc_fs_rpt_util_pkg.G_PRODUCT
403: , ' || isc_fs_rpt_util_pkg.get_bucket_drill_down
404: ( p_bucket_rec => l_bucket_rec
405: , p_view_by => l_view_by
406: , p_function_name => case
407: when l_view_by in ( isc_fs_rpt_util_pkg.G_PRODUCT
408: , isc_fs_rpt_util_pkg.G_CUSTOMER
409: , isc_fs_rpt_util_pkg.G_SEVERITY
410: , isc_fs_rpt_util_pkg.G_DISTRICT ) then
411: g_detail_rep_func
404: ( p_bucket_rec => l_bucket_rec
405: , p_view_by => l_view_by
406: , p_function_name => case
407: when l_view_by in ( isc_fs_rpt_util_pkg.G_PRODUCT
408: , isc_fs_rpt_util_pkg.G_CUSTOMER
409: , isc_fs_rpt_util_pkg.G_SEVERITY
410: , isc_fs_rpt_util_pkg.G_DISTRICT ) then
411: g_detail_rep_func
412: else null
405: , p_view_by => l_view_by
406: , p_function_name => case
407: when l_view_by in ( isc_fs_rpt_util_pkg.G_PRODUCT
408: , isc_fs_rpt_util_pkg.G_CUSTOMER
409: , isc_fs_rpt_util_pkg.G_SEVERITY
410: , isc_fs_rpt_util_pkg.G_DISTRICT ) then
411: g_detail_rep_func
412: else null
413: end
406: , p_function_name => case
407: when l_view_by in ( isc_fs_rpt_util_pkg.G_PRODUCT
408: , isc_fs_rpt_util_pkg.G_CUSTOMER
409: , isc_fs_rpt_util_pkg.G_SEVERITY
410: , isc_fs_rpt_util_pkg.G_DISTRICT ) then
411: g_detail_rep_func
412: else null
413: end
414: , p_check_column_name => 'ISC_MEASURE_5'
417: , p_check_resource => 'Y'
418: ) || '
419: from (
420: select
421: row_number() over(&ORDER_BY_CLAUSE nulls last, '|| isc_fs_rpt_util_pkg.get_inner_select_col(l_join_tbl) || ')-1 rnk
422: , iset.*
423: from ( select * from (
424: select ' || isc_fs_rpt_util_pkg.get_inner_select_col(l_join_tbl) || '
425: , ' || isc_fs_rpt_util_pkg.rate_column
420: select
421: row_number() over(&ORDER_BY_CLAUSE nulls last, '|| isc_fs_rpt_util_pkg.get_inner_select_col(l_join_tbl) || ')-1 rnk
422: , iset.*
423: from ( select * from (
424: select ' || isc_fs_rpt_util_pkg.get_inner_select_col(l_join_tbl) || '
425: , ' || isc_fs_rpt_util_pkg.rate_column
426: ( 'p_total_hours'
427: , 'p_count'
428: , 'ISC_MEASURE_1'
421: row_number() over(&ORDER_BY_CLAUSE nulls last, '|| isc_fs_rpt_util_pkg.get_inner_select_col(l_join_tbl) || ')-1 rnk
422: , iset.*
423: from ( select * from (
424: select ' || isc_fs_rpt_util_pkg.get_inner_select_col(l_join_tbl) || '
425: , ' || isc_fs_rpt_util_pkg.rate_column
426: ( 'p_total_hours'
427: , 'p_count'
428: , 'ISC_MEASURE_1'
429: , 'N'
427: , 'p_count'
428: , 'ISC_MEASURE_1'
429: , 'N'
430: ) || '
431: , ' || isc_fs_rpt_util_pkg.rate_column
432: ( 'c_total_hours'
433: , 'c_count'
434: , 'ISC_MEASURE_2'
435: , 'N'
433: , 'c_count'
434: , 'ISC_MEASURE_2'
435: , 'N'
436: ) || '
437: , ' || isc_fs_rpt_util_pkg.change_column
438: ( isc_fs_rpt_util_pkg.rate_column
439: ( 'c_total_hours'
440: , 'c_count'
441: , null
434: , 'ISC_MEASURE_2'
435: , 'N'
436: ) || '
437: , ' || isc_fs_rpt_util_pkg.change_column
438: ( isc_fs_rpt_util_pkg.rate_column
439: ( 'c_total_hours'
440: , 'c_count'
441: , null
442: , 'N'
440: , 'c_count'
441: , null
442: , 'N'
443: )
444: , isc_fs_rpt_util_pkg.rate_column
445: ( 'p_total_hours'
446: , 'p_count'
447: , null
448: , 'N'
458: , p_prefix => 'nvl(c_'
459: , p_suffix => ',0)/abs(decode(c_count,0,null,c_count))*100'
460: , p_total_flag => 'N'
461: ) || '
462: , ' || isc_fs_rpt_util_pkg.rate_column
463: ( 'p_total_hours_total'
464: , 'p_count_total'
465: , 'ISC_MEASURE_21'
466: , 'N'
464: , 'p_count_total'
465: , 'ISC_MEASURE_21'
466: , 'N'
467: ) || '
468: , ' || isc_fs_rpt_util_pkg.rate_column
469: ( 'c_total_hours_total'
470: , 'c_count_total'
471: , 'ISC_MEASURE_22'
472: , 'N'
470: , 'c_count_total'
471: , 'ISC_MEASURE_22'
472: , 'N'
473: ) || '
474: , ' || isc_fs_rpt_util_pkg.change_column
475: ( isc_fs_rpt_util_pkg.rate_column
476: ( 'c_total_hours_total'
477: , 'c_count_total'
478: , null
471: , 'ISC_MEASURE_22'
472: , 'N'
473: ) || '
474: , ' || isc_fs_rpt_util_pkg.change_column
475: ( isc_fs_rpt_util_pkg.rate_column
476: ( 'c_total_hours_total'
477: , 'c_count_total'
478: , null
479: , 'N'
477: , 'c_count_total'
478: , null
479: , 'N'
480: )
481: , isc_fs_rpt_util_pkg.rate_column
482: ( 'p_total_hours_total'
483: , 'p_count_total'
484: , null
485: , 'N'
507: , p_filter_where => '1=1 ) iset '
508: , p_generate_viewby => 'Y'
509: );
510:
511: isc_fs_rpt_util_pkg.enhance_time_join
512: ( l_stmt
513: , 'N'
514: );
515:
513: , 'N'
514: );
515:
516: -- the next line can be used to dump the contents of the PMV parameters as comments into stmt
517: -- l_stmt := l_stmt || isc_fs_rpt_util_pkg.dump_parameters(p_param);
518:
519: poa_dbi_util_pkg.get_custom_rolling_binds
520: ( p_custom_output => l_custom_output
521: , p_xtd => l_xtd
533: , x_custom_output out nocopy bis_query_attributes_tbl
534: )
535: is
536:
537: l_dimension_tbl isc_fs_rpt_util_pkg.t_dimension_tbl;
538: l_dim_filter_map poa_dbi_util_pkg.poa_dbi_dim_map;
539: l_custom_output bis_query_attributes_tbl;
540: l_curr_suffix varchar2(3);
541: l_where_clause varchar2(10000);
550: l_to_date_type varchar2(200);
551:
552: begin
553:
554: isc_fs_rpt_util_pkg.register_dimension_levels
555: ( l_dimension_tbl
556: , l_dim_filter_map
557: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
558: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
553:
554: isc_fs_rpt_util_pkg.register_dimension_levels
555: ( l_dimension_tbl
556: , l_dim_filter_map
557: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
558: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
559: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
560: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
561: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
554: isc_fs_rpt_util_pkg.register_dimension_levels
555: ( l_dimension_tbl
556: , l_dim_filter_map
557: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
558: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
559: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
560: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
561: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
562: );
555: ( l_dimension_tbl
556: , l_dim_filter_map
557: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
558: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
559: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
560: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
561: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
562: );
563:
556: , l_dim_filter_map
557: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
558: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
559: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
560: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
561: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
562: );
563:
564: isc_fs_rpt_util_pkg.process_parameters
557: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
558: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
559: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
560: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
561: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
562: );
563:
564: isc_fs_rpt_util_pkg.process_parameters
565: ( p_param => p_param
560: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
561: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
562: );
563:
564: isc_fs_rpt_util_pkg.process_parameters
565: ( p_param => p_param
566: , p_dimension_tbl => l_dimension_tbl
567: , p_dim_filter_map => l_dim_filter_map
568: , p_trend => 'Y'
608: );
609:
610: l_stmt := 'select
611: cal.name VIEWBY
612: , ' || isc_fs_rpt_util_pkg.rate_column
613: ( 'iset.p_total_hours'
614: , 'iset.p_count'
615: , 'ISC_MEASURE_1'
616: , 'N'
614: , 'iset.p_count'
615: , 'ISC_MEASURE_1'
616: , 'N'
617: ) || '
618: , ' || isc_fs_rpt_util_pkg.rate_column
619: ( 'iset.c_total_hours'
620: , 'iset.c_count'
621: , 'ISC_MEASURE_2'
622: , 'N'
620: , 'iset.c_count'
621: , 'ISC_MEASURE_2'
622: , 'N'
623: ) || '
624: , ' || isc_fs_rpt_util_pkg.change_column
625: ( isc_fs_rpt_util_pkg.rate_column
626: ( 'iset.c_total_hours'
627: , 'iset.c_count'
628: , null
621: , 'ISC_MEASURE_2'
622: , 'N'
623: ) || '
624: , ' || isc_fs_rpt_util_pkg.change_column
625: ( isc_fs_rpt_util_pkg.rate_column
626: ( 'iset.c_total_hours'
627: , 'iset.c_count'
628: , null
629: , 'N'
627: , 'iset.c_count'
628: , null
629: , 'N'
630: )
631: , isc_fs_rpt_util_pkg.rate_column
632: ( 'iset.p_total_hours'
633: , 'iset.p_count'
634: , null
635: , 'N'
636: )
637: , 'ISC_MEASURE_3'
638: , 'N'
639: ) ||
640: isc_fs_rpt_util_pkg.get_trend_drill
641: ( l_xtd
642: , g_trd_rep_func
643: , 'ISC_ATTRIBUTE_2'
644: , 'ISC_ATTRIBUTE_3'
652: , p_col_name => l_col_tbl
653: , p_use_grpid => 'N'
654: );
655:
656: isc_fs_rpt_util_pkg.enhance_time_join
657: ( l_stmt
658: , 'Y'
659: );
660:
658: , 'Y'
659: );
660:
661: -- the next line can be used to dump the contents of the PMV parameters as comments into stmt
662: -- l_stmt := l_stmt || isc_fs_rpt_util_pkg.dump_parameters(p_param);
663:
664: x_custom_sql := l_stmt;
665:
666: x_custom_output := l_custom_output;
693: , x_custom_output out nocopy bis_query_attributes_tbl
694: )
695: as
696:
697: l_dimension_tbl isc_fs_rpt_util_pkg.t_dimension_tbl;
698: l_dim_filter_map poa_dbi_util_pkg.poa_dbi_dim_map;
699: l_custom_output bis_query_attributes_tbl;
700: l_curr_suffix varchar2(3);
701: l_where_clause varchar2(10000);
708: l_cost_element varchar2(200);
709: l_col_tbl poa_dbi_util_pkg.poa_dbi_col_tbl;
710: l_stmt varchar2(32767);
711: l_rank_order varchar2(200);
712: l_detail_col_tbl isc_fs_rpt_util_pkg.t_detail_column_tbl;
713: l_order_by varchar2(200);
714: l_asc_desc varchar2(100);
715:
716: begin
714: l_asc_desc varchar2(100);
715:
716: begin
717:
718: isc_fs_rpt_util_pkg.register_dimension_levels
719: ( l_dimension_tbl
720: , l_dim_filter_map
721: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
722: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
717:
718: isc_fs_rpt_util_pkg.register_dimension_levels
719: ( l_dimension_tbl
720: , l_dim_filter_map
721: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
722: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
723: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
724: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
725: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
718: isc_fs_rpt_util_pkg.register_dimension_levels
719: ( l_dimension_tbl
720: , l_dim_filter_map
721: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
722: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
723: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
724: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
725: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
726: , isc_fs_rpt_util_pkg.G_TASK_OWNER, 'N'
719: ( l_dimension_tbl
720: , l_dim_filter_map
721: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
722: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
723: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
724: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
725: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
726: , isc_fs_rpt_util_pkg.G_TASK_OWNER, 'N'
727: , isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE, 'N'
720: , l_dim_filter_map
721: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
722: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
723: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
724: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
725: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
726: , isc_fs_rpt_util_pkg.G_TASK_OWNER, 'N'
727: , isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE, 'N'
728: );
721: , isc_fs_rpt_util_pkg.G_CATEGORY, 'Y'
722: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
723: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
724: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
725: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
726: , isc_fs_rpt_util_pkg.G_TASK_OWNER, 'N'
727: , isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE, 'N'
728: );
729:
722: , isc_fs_rpt_util_pkg.G_PRODUCT, 'Y'
723: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
724: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
725: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
726: , isc_fs_rpt_util_pkg.G_TASK_OWNER, 'N'
727: , isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE, 'N'
728: );
729:
730: isc_fs_rpt_util_pkg.process_parameters
723: , isc_fs_rpt_util_pkg.G_CUSTOMER, 'Y'
724: , isc_fs_rpt_util_pkg.G_DISTRICT, 'Y'
725: , isc_fs_rpt_util_pkg.G_SEVERITY, 'Y'
726: , isc_fs_rpt_util_pkg.G_TASK_OWNER, 'N'
727: , isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE, 'N'
728: );
729:
730: isc_fs_rpt_util_pkg.process_parameters
731: ( p_param => p_param
726: , isc_fs_rpt_util_pkg.G_TASK_OWNER, 'N'
727: , isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE, 'N'
728: );
729:
730: isc_fs_rpt_util_pkg.process_parameters
731: ( p_param => p_param
732: , p_dimension_tbl => l_dimension_tbl
733: , p_dim_filter_map => l_dim_filter_map
734: , p_trend => 'D'
748: , l_dim_bmap
749: , l_custom_output
750: );
751:
752: l_order_by := isc_fs_rpt_util_pkg.get_parameter_value
753: ( p_param
754: , 'ORDERBY'
755: );
756:
769: end ||
770: l_asc_desc ||
771: 'nulls last, task_id';
772:
773: isc_fs_rpt_util_pkg.add_detail_column
774: ( p_detail_col_tbl => l_detail_col_tbl
775: , p_dimension_tbl => l_dimension_tbl
776: , p_fact_col_name => 'source_object_name'
777: , p_fact_col_total => 'N'
777: , p_fact_col_total => 'N'
778: , p_column_key => 'source_object_name'
779: );
780:
781: isc_fs_rpt_util_pkg.add_detail_column
782: ( p_detail_col_tbl => l_detail_col_tbl
783: , p_dimension_tbl => l_dimension_tbl
784: , p_fact_col_name => 'source_object_id'
785: , p_fact_col_total => 'N'
785: , p_fact_col_total => 'N'
786: , p_column_key => 'source_object_id'
787: );
788:
789: isc_fs_rpt_util_pkg.add_detail_column
790: ( p_detail_col_tbl => l_detail_col_tbl
791: , p_dimension_tbl => l_dimension_tbl
792: , p_dimension_level => isc_fs_rpt_util_pkg.G_CUSTOMER
793: , p_column_key => 'customer'
788:
789: isc_fs_rpt_util_pkg.add_detail_column
790: ( p_detail_col_tbl => l_detail_col_tbl
791: , p_dimension_tbl => l_dimension_tbl
792: , p_dimension_level => isc_fs_rpt_util_pkg.G_CUSTOMER
793: , p_column_key => 'customer'
794: );
795:
796: isc_fs_rpt_util_pkg.add_detail_column
792: , p_dimension_level => isc_fs_rpt_util_pkg.G_CUSTOMER
793: , p_column_key => 'customer'
794: );
795:
796: isc_fs_rpt_util_pkg.add_detail_column
797: ( p_detail_col_tbl => l_detail_col_tbl
798: , p_dimension_tbl => l_dimension_tbl
799: , p_dimension_level => isc_fs_rpt_util_pkg.G_PRODUCT
800: , p_column_key => 'product'
795:
796: isc_fs_rpt_util_pkg.add_detail_column
797: ( p_detail_col_tbl => l_detail_col_tbl
798: , p_dimension_tbl => l_dimension_tbl
799: , p_dimension_level => isc_fs_rpt_util_pkg.G_PRODUCT
800: , p_column_key => 'product'
801: );
802:
803: isc_fs_rpt_util_pkg.add_detail_column
799: , p_dimension_level => isc_fs_rpt_util_pkg.G_PRODUCT
800: , p_column_key => 'product'
801: );
802:
803: isc_fs_rpt_util_pkg.add_detail_column
804: ( p_detail_col_tbl => l_detail_col_tbl
805: , p_dimension_tbl => l_dimension_tbl
806: , p_fact_col_name => 'task_number'
807: , p_fact_col_total => 'N'
807: , p_fact_col_total => 'N'
808: , p_column_key => 'task_number'
809: );
810:
811: isc_fs_rpt_util_pkg.add_detail_column
812: ( p_detail_col_tbl => l_detail_col_tbl
813: , p_dimension_tbl => l_dimension_tbl
814: , p_fact_col_name => 'task_id'
815: , p_fact_col_total => 'N'
815: , p_fact_col_total => 'N'
816: , p_column_key => 'task_id'
817: );
818:
819: isc_fs_rpt_util_pkg.add_detail_column
820: ( p_detail_col_tbl => l_detail_col_tbl
821: , p_dimension_tbl => l_dimension_tbl
822: , p_dimension_level => isc_fs_rpt_util_pkg.G_TASK_OWNER
823: , p_column_key => 'task_owner'
818:
819: isc_fs_rpt_util_pkg.add_detail_column
820: ( p_detail_col_tbl => l_detail_col_tbl
821: , p_dimension_tbl => l_dimension_tbl
822: , p_dimension_level => isc_fs_rpt_util_pkg.G_TASK_OWNER
823: , p_column_key => 'task_owner'
824: );
825:
826: isc_fs_rpt_util_pkg.add_detail_column
822: , p_dimension_level => isc_fs_rpt_util_pkg.G_TASK_OWNER
823: , p_column_key => 'task_owner'
824: );
825:
826: isc_fs_rpt_util_pkg.add_detail_column
827: ( p_detail_col_tbl => l_detail_col_tbl
828: , p_dimension_tbl => l_dimension_tbl
829: , p_dimension_level => isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE
830: , p_column_key => 'task_assignee'
825:
826: isc_fs_rpt_util_pkg.add_detail_column
827: ( p_detail_col_tbl => l_detail_col_tbl
828: , p_dimension_tbl => l_dimension_tbl
829: , p_dimension_level => isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE
830: , p_column_key => 'task_assignee'
831: );
832:
833: isc_fs_rpt_util_pkg.add_detail_column
829: , p_dimension_level => isc_fs_rpt_util_pkg.G_TASK_ASSIGNEE
830: , p_column_key => 'task_assignee'
831: );
832:
833: isc_fs_rpt_util_pkg.add_detail_column
834: ( p_detail_col_tbl => l_detail_col_tbl
835: , p_dimension_tbl => l_dimension_tbl
836: , p_fact_col_name => 'report_date'
837: , p_fact_col_total => 'N'
837: , p_fact_col_total => 'N'
838: , p_column_key => 'report_date'
839: );
840:
841: isc_fs_rpt_util_pkg.add_detail_column
842: ( p_detail_col_tbl => l_detail_col_tbl
843: , p_dimension_tbl => l_dimension_tbl
844: , p_fact_col_name => 'time_to_resolve'
845: , p_fact_col_total => 'N'
847: );
848:
849: l_stmt := 'select
850: oset.source_object_name ISC_ATTRIBUTE_1
851: , ' || isc_fs_rpt_util_pkg.get_detail_column
852: (l_detail_col_tbl,'customer','ISC_ATTRIBUTE_2') || '
853: , ' || isc_fs_rpt_util_pkg.get_detail_column
854: (l_detail_col_tbl,'product','ISC_ATTRIBUTE_3') || '
855: , oset.task_number ISC_ATTRIBUTE_4
849: l_stmt := 'select
850: oset.source_object_name ISC_ATTRIBUTE_1
851: , ' || isc_fs_rpt_util_pkg.get_detail_column
852: (l_detail_col_tbl,'customer','ISC_ATTRIBUTE_2') || '
853: , ' || isc_fs_rpt_util_pkg.get_detail_column
854: (l_detail_col_tbl,'product','ISC_ATTRIBUTE_3') || '
855: , oset.task_number ISC_ATTRIBUTE_4
856: , ' || isc_fs_rpt_util_pkg.get_detail_column
857: (l_detail_col_tbl,'task_owner','ISC_ATTRIBUTE_5') || '
852: (l_detail_col_tbl,'customer','ISC_ATTRIBUTE_2') || '
853: , ' || isc_fs_rpt_util_pkg.get_detail_column
854: (l_detail_col_tbl,'product','ISC_ATTRIBUTE_3') || '
855: , oset.task_number ISC_ATTRIBUTE_4
856: , ' || isc_fs_rpt_util_pkg.get_detail_column
857: (l_detail_col_tbl,'task_owner','ISC_ATTRIBUTE_5') || '
858: , ' || isc_fs_rpt_util_pkg.get_detail_column
859: (l_detail_col_tbl,'task_assignee','ISC_ATTRIBUTE_6') || '
860: , oset.report_date ISC_MEASURE_1
854: (l_detail_col_tbl,'product','ISC_ATTRIBUTE_3') || '
855: , oset.task_number ISC_ATTRIBUTE_4
856: , ' || isc_fs_rpt_util_pkg.get_detail_column
857: (l_detail_col_tbl,'task_owner','ISC_ATTRIBUTE_5') || '
858: , ' || isc_fs_rpt_util_pkg.get_detail_column
859: (l_detail_col_tbl,'task_assignee','ISC_ATTRIBUTE_6') || '
860: , oset.report_date ISC_MEASURE_1
861: , oset.time_to_resolve ISC_MEASURE_2
862: , ' || isc_fs_rpt_util_pkg.get_sr_detail_page_function('oset.source_object_id') || ' ISC_ATTRIBUTE_7
858: , ' || isc_fs_rpt_util_pkg.get_detail_column
859: (l_detail_col_tbl,'task_assignee','ISC_ATTRIBUTE_6') || '
860: , oset.report_date ISC_MEASURE_1
861: , oset.time_to_resolve ISC_MEASURE_2
862: , ' || isc_fs_rpt_util_pkg.get_sr_detail_page_function('oset.source_object_id') || ' ISC_ATTRIBUTE_7
863: , null ISC_ATTRIBUTE_8'
864: -- above is needed to associate bucket set with report
865: || '
866: , ' || isc_fs_rpt_util_pkg.get_task_detail_page_function('oset.task_id') || ' ISC_ATTRIBUTE_9
862: , ' || isc_fs_rpt_util_pkg.get_sr_detail_page_function('oset.source_object_id') || ' ISC_ATTRIBUTE_7
863: , null ISC_ATTRIBUTE_8'
864: -- above is needed to associate bucket set with report
865: || '
866: , ' || isc_fs_rpt_util_pkg.get_task_detail_page_function('oset.task_id') || ' ISC_ATTRIBUTE_9
867: from
868: ' || isc_fs_rpt_util_pkg.detail_sql
869: ( p_detail_col_tbl => l_detail_col_tbl
870: , p_dimension_tbl => l_dimension_tbl
864: -- above is needed to associate bucket set with report
865: || '
866: , ' || isc_fs_rpt_util_pkg.get_task_detail_page_function('oset.task_id') || ' ISC_ATTRIBUTE_9
867: from
868: ' || isc_fs_rpt_util_pkg.detail_sql
869: ( p_detail_col_tbl => l_detail_col_tbl
870: , p_dimension_tbl => l_dimension_tbl
871: , p_mv_name => l_mv
872: , p_where_clause => l_where_clause || ' and time_to_resolve between &ISC_FS_LOW and &ISC_FS_HIGH'
874: , p_override_date_clause => 'report_date >= &BIS_CURRENT_EFFECTIVE_START_DATE and report_date < &BIS_CURRENT_ASOF_DATE +1'
875: );
876:
877: -- the next line can be used to dump the contents of the PMV parameters as comments into stmt
878: -- l_stmt := l_stmt || isc_fs_rpt_util_pkg.dump_parameters(p_param);
879:
880: x_custom_sql := l_stmt;
881:
882: isc_fs_rpt_util_pkg.bind_low_high
878: -- l_stmt := l_stmt || isc_fs_rpt_util_pkg.dump_parameters(p_param);
879:
880: x_custom_sql := l_stmt;
881:
882: isc_fs_rpt_util_pkg.bind_low_high
883: ( p_param
884: , isc_fs_rpt_util_pkg.G_TIME_TO_RES_DISTRIB
885: , 'BIV_FS_TIME_TO_RES'
886: , l_custom_output
880: x_custom_sql := l_stmt;
881:
882: isc_fs_rpt_util_pkg.bind_low_high
883: ( p_param
884: , isc_fs_rpt_util_pkg.G_TIME_TO_RES_DISTRIB
885: , 'BIV_FS_TIME_TO_RES'
886: , l_custom_output
887: );
888: