1
    LOAD

    number as [Case Number],
    number as key_case,
    short_description as Description,
    ApplyMap('map_CustomerDeliveryGroup',dv_company,'N/A') as CustomerGroupNo,
    mid(dv_priority,5) as Priority, 
    dv_business_service as Service,
    dv_state as State,
    dv_category as ServiceCI,
    DATE(SUBFIELD(sys_created_on,' ',1)) as key_reported_date,
IF(DATE(SUBFIELD(sys_created_on,' ',1)) > monthstart(today()-360),'1','0') as InYear,
    text(applymap('map_wanted_customers',upper(dv_company),0)) as WantedCustomer,
    contact_type, 
    dv_contact as contact,
   dv_company as Customer,
    dv_assignment_group as Assigned_Group,
    dv_assigned_to as Assignee
FROM [lib];


dv_task as key_case,
dv_stage as ResponseStage,
business_percentage as ResponseLeft,
IF(business_percentage <= 100, 'Met','Missed') as SLA_Response_MeasurementStatus_Name,
DATE(SUBFIELD(end_time ,' ',1)) as ResponseTime 
FROM [lib]
WHERE wildmatch(dv_sla,'*Response*')
and exists([Case Number],dv_task)
and dv_stage = 'Completed';
webprogrammer
  • 2,393
  • 3
  • 21
  • 27

1 Answers1

0
  • your table probably contains records from different stage of case, something like log,
  • there is second table with key_case which makes joins and it can also affect data,

it is really hard to give exact answer without seeing data model/data or just qvw file

Hubert Dudek
  • 1,666
  • 1
  • 13
  • 21