<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info>
    <name>postponement_percents</name>
    <name_sync_with_filename>Y</name_sync_with_filename>
    <description/>
    <extended_description/>
    <pipeline_version/>
    <pipeline_type>Normal</pipeline_type>
    <parameters>
    </parameters>
    <capture_transform_performance>N</capture_transform_performance>
    <transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
    <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
    <created_user>-</created_user>
    <created_date>2025/03/21 14:21:43.089</created_date>
    <modified_user>-</modified_user>
    <modified_date>2025/03/21 14:21:43.089</modified_date>
  </info>
  <notepads>
  </notepads>
  <order>
    <hop>
      <from>Table input</from>
      <to>Update</to>
      <enabled>Y</enabled>
    </hop>
  </order>
  <transform>
    <name>Table input</name>
    <type>TableInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <connection>ervu-dashboard</connection>
    <execute_each_row>N</execute_each_row>
    <limit>0</limit>
    <sql>SELECT
    current_date AS recording_date,
    spring_autumn,
    recruitment_id,
    ROUND(COALESCE(SUM(postponement_have_right) * 100 / NULLIF(SUM(new_recruits), 0), 0), 1) AS postponement_have_right_percent,
    ROUND(COALESCE(SUM(postponement_granted) * 100 / NULLIF(SUM(new_recruits), 0), 0), 1) AS postponement_granted_percent
FROM main_dashboard.recruitment_campaign
WHERE recording_date = current_date
    AND schema = 'empty'
GROUP BY recruitment_id, spring_autumn;</sql>
    <variables_active>N</variables_active>
    <attributes/>
    <GUI>
      <xloc>480</xloc>
      <yloc>256</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Update</name>
    <type>Update</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <commit>100</commit>
    <connection>ervu-dashboard</connection>
    <error_ignored>Y</error_ignored>
    <lookup>
      <key>
        <condition>=</condition>
        <field>spring_autumn</field>
        <name>spring_autumn</name>
      </key>
      <key>
        <condition>=</condition>
        <field>recruitment_id</field>
        <name>recruitment_id</name>
      </key>
      <key>
        <condition>=</condition>
        <field>recording_date</field>
        <name>recording_date</name>
      </key>
      <schema>main_dashboard</schema>
      <table>recruitment_campaign</table>
      <value>
        <name>postponement_have_right_percent</name>
        <rename>postponement_have_right_percent</rename>
      </value>
      <value>
        <name>postponement_granted_percent</name>
        <rename>postponement_granted_percent</rename>
      </value>
    </lookup>
    <skip_lookup>N</skip_lookup>
    <use_batch>Y</use_batch>
    <attributes/>
    <GUI>
      <xloc>800</xloc>
      <yloc>256</yloc>
    </GUI>
  </transform>
  <transform_error_handling>
  </transform_error_handling>
  <attributes/>
</pipeline>
