change country counting

This commit is contained in:
Ruslan 2024-12-28 10:22:04 +03:00
parent 1940b40a6a
commit 1fd405140a
20 changed files with 6054 additions and 4063 deletions

View file

@ -550,6 +550,51 @@
<to>Insert / update (total_registered.busyness) 3</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Get variables 3 2 3</from>
<to>Select values 3 2 3</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Get variables 3 2 2 3</from>
<to>Select values 3 2 2 3</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Get variables 3 2 2 2 2</from>
<to>Select values 3 2 2 2 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Select values 3 2 3</from>
<to>Insert / update (total_registered.busyness) 4</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Select values 3 2 2 3</from>
<to>Insert / update (total_registered.busyness) 2 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Select values 3 2 2 2 2</from>
<to>Insert / update (total_registered.busyness) 3 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input (person_registry) РФ/все 2</from>
<to>Get variables 3 2 3</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input (person_registry) РФ/женщины 2</from>
<to>Get variables 3 2 2 2 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input (person_registry) РФ/мужчины 2</from>
<to>Get variables 3 2 2 3</to>
<enabled>Y</enabled>
</hop>
</order>
<step>
<name>Get variables 3 2</name>
@ -1448,6 +1493,903 @@ AND recording_date = CURRENT_DATE;</sql>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Get variables 3 2 3</name>
<type>GetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<name>REG_ID</name>
<variable/>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
</field>
<field>
<name>VK_ARRAY</name>
<variable/>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
</field>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>683</xloc>
<yloc>661</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Get variables 3 2 2 3</name>
<type>GetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<name>REG_ID</name>
<variable/>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
</field>
<field>
<name>VK_ARRAY</name>
<variable/>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
</field>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>683</xloc>
<yloc>821</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Get variables 3 2 2 2 2</name>
<type>GetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<name>REG_ID</name>
<variable/>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
</field>
<field>
<name>VK_ARRAY</name>
<variable/>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
</field>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>683</xloc>
<yloc>981</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Insert / update (total_registered.busyness) 4</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<commit>100</commit>
<update_bypassed>Y</update_bypassed>
<lookup>
<schema>total_registered</schema>
<table>busyness</table>
<key>
<name>REG_ID</name>
<field>recruitment_id</field>
<condition>=</condition>
<name2/>
</key>
<key>
<name>schema</name>
<field>schema</field>
<condition>=</condition>
<name2/>
</key>
<value>
<name>study</name>
<rename>study</rename>
<update>Y</update>
</value>
<value>
<name>work</name>
<rename>work</rename>
<update>Y</update>
</value>
<value>
<name>study_percent</name>
<rename>study_percent</rename>
<update>Y</update>
</value>
<value>
<name>work_percent</name>
<rename>work_percent</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_id</name>
<rename>recruitment_id</rename>
<update>N</update>
</value>
<value>
<name>registered</name>
<rename>registered</rename>
<update>N</update>
</value>
<value>
<name>"all_M_W"</name>
<rename>gender</rename>
<update>N</update>
</value>
<value>
<name>not_work</name>
<rename>not_work</rename>
<update>Y</update>
</value>
<value>
<name>not_work_percent</name>
<rename>not_work_percent</rename>
<update>Y</update>
</value>
<value>
<name>busyness</name>
<rename>total_people</rename>
<update>Y</update>
</value>
<value>
<name>schema</name>
<rename>schema</rename>
<update>N</update>
</value>
</lookup>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>1083</xloc>
<yloc>661</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Insert / update (total_registered.busyness) 2 2</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<commit>100</commit>
<update_bypassed>Y</update_bypassed>
<lookup>
<schema>total_registered</schema>
<table>busyness</table>
<key>
<name>REG_ID</name>
<field>recruitment_id</field>
<condition>=</condition>
<name2/>
</key>
<key>
<name>schema</name>
<field>schema</field>
<condition>=</condition>
<name2/>
</key>
<value>
<name>study</name>
<rename>study</rename>
<update>Y</update>
</value>
<value>
<name>work</name>
<rename>work</rename>
<update>Y</update>
</value>
<value>
<name>study_percent</name>
<rename>study_percent</rename>
<update>Y</update>
</value>
<value>
<name>work_percent</name>
<rename>work_percent</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_id</name>
<rename>recruitment_id</rename>
<update>N</update>
</value>
<value>
<name>registered</name>
<rename>registered</rename>
<update>N</update>
</value>
<value>
<name>"all_M_W"</name>
<rename>gender</rename>
<update>N</update>
</value>
<value>
<name>not_work</name>
<rename>not_work</rename>
<update>Y</update>
</value>
<value>
<name>not_work_percent</name>
<rename>not_work_percent</rename>
<update>Y</update>
</value>
<value>
<name>busyness</name>
<rename>total_people</rename>
<update>Y</update>
</value>
<value>
<name>schema</name>
<rename>schema</rename>
<update>N</update>
</value>
</lookup>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>1083</xloc>
<yloc>821</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Insert / update (total_registered.busyness) 3 2</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<commit>100</commit>
<update_bypassed>Y</update_bypassed>
<lookup>
<schema>total_registered</schema>
<table>busyness</table>
<key>
<name>REG_ID</name>
<field>recruitment_id</field>
<condition>=</condition>
<name2/>
</key>
<key>
<name>schema</name>
<field>schema</field>
<condition>=</condition>
<name2/>
</key>
<value>
<name>study</name>
<rename>study</rename>
<update>Y</update>
</value>
<value>
<name>work</name>
<rename>work</rename>
<update>Y</update>
</value>
<value>
<name>study_percent</name>
<rename>study_percent</rename>
<update>Y</update>
</value>
<value>
<name>work_percent</name>
<rename>work_percent</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_id</name>
<rename>recruitment_id</rename>
<update>N</update>
</value>
<value>
<name>registered</name>
<rename>registered</rename>
<update>N</update>
</value>
<value>
<name>"all_M_W"</name>
<rename>gender</rename>
<update>N</update>
</value>
<value>
<name>not_work</name>
<rename>not_work</rename>
<update>Y</update>
</value>
<value>
<name>not_work_percent</name>
<rename>not_work_percent</rename>
<update>Y</update>
</value>
<value>
<name>busyness</name>
<rename>total_people</rename>
<update>Y</update>
</value>
<value>
<name>schema</name>
<rename>schema</rename>
<update>N</update>
</value>
</lookup>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>1083</xloc>
<yloc>981</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Select values 3 2 3</name>
<type>SelectValues</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<select_unspecified>N</select_unspecified>
<meta>
<name>REG_ID</name>
<rename>REG_ID</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
<meta>
<name>VK_ARRAY</name>
<rename>VK_ARRAY</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>827</xloc>
<yloc>661</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Select values 3 2 2 3</name>
<type>SelectValues</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<select_unspecified>N</select_unspecified>
<meta>
<name>REG_ID</name>
<rename>REG_ID</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
<meta>
<name>VK_ARRAY</name>
<rename>VK_ARRAY</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>827</xloc>
<yloc>821</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Select values 3 2 2 2 2</name>
<type>SelectValues</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<select_unspecified>N</select_unspecified>
<meta>
<name>REG_ID</name>
<rename>REG_ID</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
<meta>
<name>VK_ARRAY</name>
<rename>VK_ARRAY</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>827</xloc>
<yloc>981</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input (person_registry) РФ/все 2</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<sql>SELECT
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(study) END AS study,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(work) END AS work,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(study) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS study_percent,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(study) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS work_percent,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(not_work) END AS not_work,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(not_work) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS not_work_percent,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(busyness) END AS total_people,
'${REG_ID}' AS recruitment_id,
'ALL' AS gender,
'false' AS registered,
'Organization' AS schema
FROM total_registered.busyness
WHERE recruitment_id = ANY (
string_to_array(
trim(both '{}' FROM replace('${VK_ARRAY}', ' ', '')), ','
)::uuid[]
)
AND registered = 'false'
AND "all_M_W" = 'ALL'
AND recording_date = CURRENT_DATE;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>Y</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>443</xloc>
<yloc>661</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input (person_registry) РФ/женщины 2</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<sql>SELECT
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(study) END AS study,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(work) END AS work,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(study) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS study_percent,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(study) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS work_percent,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(not_work) END AS not_work,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(not_work) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS not_work_percent,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(busyness) END AS total_people,
'${REG_ID}' AS recruitment_id,
'W' AS gender,
'false' AS registered,
'Organization' AS schema
FROM total_registered.busyness
WHERE recruitment_id = ANY (
string_to_array(
trim(both '{}' FROM replace('${VK_ARRAY}', ' ', '')), ','
)::uuid[]
)
AND registered = 'false'
AND "all_M_W" = 'W'
AND recording_date = CURRENT_DATE;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>Y</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>443</xloc>
<yloc>981</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input (person_registry) РФ/мужчины 2</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<sql>SELECT
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(study) END AS study,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(work) END AS work,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(study) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS study_percent,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(study) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS work_percent,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(not_work) END AS not_work,
CASE
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE
WHEN SUM(busyness) > 0
THEN ROUND((SUM(not_work) / SUM(busyness) * 100), 2)
ELSE 0
END,
0
)
END AS not_work_percent,
CASE WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = '' THEN 0 ELSE SUM(busyness) END AS total_people,
'${REG_ID}' AS recruitment_id,
'M' AS gender,
'false' AS registered,
'Organization' AS schema
FROM total_registered.busyness
WHERE recruitment_id = ANY (
string_to_array(
trim(both '{}' FROM replace('${VK_ARRAY}', ' ', '')), ','
)::uuid[]
)
AND registered = 'false'
AND "all_M_W" = 'M'
AND recording_date = CURRENT_DATE;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>Y</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>443</xloc>
<yloc>821</yloc>
<draw>Y</draw>
</GUI>
</step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>