summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--calculate_inventory.ktr3529
-rw-r--r--import_delivery_order.kjb48
-rw-r--r--import_stock_location.ktr298
3 files changed, 3726 insertions, 149 deletions
diff --git a/calculate_inventory.ktr b/calculate_inventory.ktr
new file mode 100644
index 0000000..a81dd45
--- /dev/null
+++ b/calculate_inventory.ktr
@@ -0,0 +1,3529 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+ <info>
+ <name>calculate_inventory</name>
+ <description/>
+ <extended_description/>
+ <trans_version/>
+ <trans_type>Normal</trans_type>
+ <directory>/</directory>
+ <parameters>
+ </parameters>
+ <log>
+ <trans-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <size_limit_lines/>
+ <interval/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>TRANSNAME</id>
+ <enabled>Y</enabled>
+ <name>TRANSNAME</name>
+ </field>
+ <field>
+ <id>STATUS</id>
+ <enabled>Y</enabled>
+ <name>STATUS</name>
+ </field>
+ <field>
+ <id>LINES_READ</id>
+ <enabled>Y</enabled>
+ <name>LINES_READ</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_WRITTEN</id>
+ <enabled>Y</enabled>
+ <name>LINES_WRITTEN</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_UPDATED</id>
+ <enabled>Y</enabled>
+ <name>LINES_UPDATED</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_INPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_INPUT</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_OUTPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_OUTPUT</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_REJECTED</id>
+ <enabled>Y</enabled>
+ <name>LINES_REJECTED</name>
+ <subject/>
+ </field>
+ <field>
+ <id>ERRORS</id>
+ <enabled>Y</enabled>
+ <name>ERRORS</name>
+ </field>
+ <field>
+ <id>STARTDATE</id>
+ <enabled>Y</enabled>
+ <name>STARTDATE</name>
+ </field>
+ <field>
+ <id>ENDDATE</id>
+ <enabled>Y</enabled>
+ <name>ENDDATE</name>
+ </field>
+ <field>
+ <id>LOGDATE</id>
+ <enabled>Y</enabled>
+ <name>LOGDATE</name>
+ </field>
+ <field>
+ <id>DEPDATE</id>
+ <enabled>Y</enabled>
+ <name>DEPDATE</name>
+ </field>
+ <field>
+ <id>REPLAYDATE</id>
+ <enabled>Y</enabled>
+ <name>REPLAYDATE</name>
+ </field>
+ <field>
+ <id>LOG_FIELD</id>
+ <enabled>Y</enabled>
+ <name>LOG_FIELD</name>
+ </field>
+ <field>
+ <id>EXECUTING_SERVER</id>
+ <enabled>N</enabled>
+ <name>EXECUTING_SERVER</name>
+ </field>
+ <field>
+ <id>EXECUTING_USER</id>
+ <enabled>N</enabled>
+ <name>EXECUTING_USER</name>
+ </field>
+ <field>
+ <id>CLIENT</id>
+ <enabled>N</enabled>
+ <name>CLIENT</name>
+ </field>
+ </trans-log-table>
+ <perf-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <interval/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>SEQ_NR</id>
+ <enabled>Y</enabled>
+ <name>SEQ_NR</name>
+ </field>
+ <field>
+ <id>LOGDATE</id>
+ <enabled>Y</enabled>
+ <name>LOGDATE</name>
+ </field>
+ <field>
+ <id>TRANSNAME</id>
+ <enabled>Y</enabled>
+ <name>TRANSNAME</name>
+ </field>
+ <field>
+ <id>STEPNAME</id>
+ <enabled>Y</enabled>
+ <name>STEPNAME</name>
+ </field>
+ <field>
+ <id>STEP_COPY</id>
+ <enabled>Y</enabled>
+ <name>STEP_COPY</name>
+ </field>
+ <field>
+ <id>LINES_READ</id>
+ <enabled>Y</enabled>
+ <name>LINES_READ</name>
+ </field>
+ <field>
+ <id>LINES_WRITTEN</id>
+ <enabled>Y</enabled>
+ <name>LINES_WRITTEN</name>
+ </field>
+ <field>
+ <id>LINES_UPDATED</id>
+ <enabled>Y</enabled>
+ <name>LINES_UPDATED</name>
+ </field>
+ <field>
+ <id>LINES_INPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_INPUT</name>
+ </field>
+ <field>
+ <id>LINES_OUTPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_OUTPUT</name>
+ </field>
+ <field>
+ <id>LINES_REJECTED</id>
+ <enabled>Y</enabled>
+ <name>LINES_REJECTED</name>
+ </field>
+ <field>
+ <id>ERRORS</id>
+ <enabled>Y</enabled>
+ <name>ERRORS</name>
+ </field>
+ <field>
+ <id>INPUT_BUFFER_ROWS</id>
+ <enabled>Y</enabled>
+ <name>INPUT_BUFFER_ROWS</name>
+ </field>
+ <field>
+ <id>OUTPUT_BUFFER_ROWS</id>
+ <enabled>Y</enabled>
+ <name>OUTPUT_BUFFER_ROWS</name>
+ </field>
+ </perf-log-table>
+ <channel-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>LOG_DATE</id>
+ <enabled>Y</enabled>
+ <name>LOG_DATE</name>
+ </field>
+ <field>
+ <id>LOGGING_OBJECT_TYPE</id>
+ <enabled>Y</enabled>
+ <name>LOGGING_OBJECT_TYPE</name>
+ </field>
+ <field>
+ <id>OBJECT_NAME</id>
+ <enabled>Y</enabled>
+ <name>OBJECT_NAME</name>
+ </field>
+ <field>
+ <id>OBJECT_COPY</id>
+ <enabled>Y</enabled>
+ <name>OBJECT_COPY</name>
+ </field>
+ <field>
+ <id>REPOSITORY_DIRECTORY</id>
+ <enabled>Y</enabled>
+ <name>REPOSITORY_DIRECTORY</name>
+ </field>
+ <field>
+ <id>FILENAME</id>
+ <enabled>Y</enabled>
+ <name>FILENAME</name>
+ </field>
+ <field>
+ <id>OBJECT_ID</id>
+ <enabled>Y</enabled>
+ <name>OBJECT_ID</name>
+ </field>
+ <field>
+ <id>OBJECT_REVISION</id>
+ <enabled>Y</enabled>
+ <name>OBJECT_REVISION</name>
+ </field>
+ <field>
+ <id>PARENT_CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>PARENT_CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>ROOT_CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>ROOT_CHANNEL_ID</name>
+ </field>
+ </channel-log-table>
+ <step-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>LOG_DATE</id>
+ <enabled>Y</enabled>
+ <name>LOG_DATE</name>
+ </field>
+ <field>
+ <id>TRANSNAME</id>
+ <enabled>Y</enabled>
+ <name>TRANSNAME</name>
+ </field>
+ <field>
+ <id>STEPNAME</id>
+ <enabled>Y</enabled>
+ <name>STEPNAME</name>
+ </field>
+ <field>
+ <id>STEP_COPY</id>
+ <enabled>Y</enabled>
+ <name>STEP_COPY</name>
+ </field>
+ <field>
+ <id>LINES_READ</id>
+ <enabled>Y</enabled>
+ <name>LINES_READ</name>
+ </field>
+ <field>
+ <id>LINES_WRITTEN</id>
+ <enabled>Y</enabled>
+ <name>LINES_WRITTEN</name>
+ </field>
+ <field>
+ <id>LINES_UPDATED</id>
+ <enabled>Y</enabled>
+ <name>LINES_UPDATED</name>
+ </field>
+ <field>
+ <id>LINES_INPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_INPUT</name>
+ </field>
+ <field>
+ <id>LINES_OUTPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_OUTPUT</name>
+ </field>
+ <field>
+ <id>LINES_REJECTED</id>
+ <enabled>Y</enabled>
+ <name>LINES_REJECTED</name>
+ </field>
+ <field>
+ <id>ERRORS</id>
+ <enabled>Y</enabled>
+ <name>ERRORS</name>
+ </field>
+ <field>
+ <id>LOG_FIELD</id>
+ <enabled>N</enabled>
+ <name>LOG_FIELD</name>
+ </field>
+ </step-log-table>
+ <metrics-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>LOG_DATE</id>
+ <enabled>Y</enabled>
+ <name>LOG_DATE</name>
+ </field>
+ <field>
+ <id>METRICS_DATE</id>
+ <enabled>Y</enabled>
+ <name>METRICS_DATE</name>
+ </field>
+ <field>
+ <id>METRICS_CODE</id>
+ <enabled>Y</enabled>
+ <name>METRICS_CODE</name>
+ </field>
+ <field>
+ <id>METRICS_DESCRIPTION</id>
+ <enabled>Y</enabled>
+ <name>METRICS_DESCRIPTION</name>
+ </field>
+ <field>
+ <id>METRICS_SUBJECT</id>
+ <enabled>Y</enabled>
+ <name>METRICS_SUBJECT</name>
+ </field>
+ <field>
+ <id>METRICS_TYPE</id>
+ <enabled>Y</enabled>
+ <name>METRICS_TYPE</name>
+ </field>
+ <field>
+ <id>METRICS_VALUE</id>
+ <enabled>Y</enabled>
+ <name>METRICS_VALUE</name>
+ </field>
+ </metrics-log-table>
+ </log>
+ <maxdate>
+ <connection/>
+ <table/>
+ <field/>
+ <offset>0.0</offset>
+ <maxdiff>0.0</maxdiff>
+ </maxdate>
+ <size_rowset>10000</size_rowset>
+ <sleep_time_empty>50</sleep_time_empty>
+ <sleep_time_full>50</sleep_time_full>
+ <unique_connections>N</unique_connections>
+ <feedback_shown>Y</feedback_shown>
+ <feedback_size>50000</feedback_size>
+ <using_thread_priorities>Y</using_thread_priorities>
+ <shared_objects_file/>
+ <capture_step_performance>N</capture_step_performance>
+ <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+ <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+ <dependencies>
+ </dependencies>
+ <partitionschemas>
+ </partitionschemas>
+ <slaveservers>
+ </slaveservers>
+ <clusterschemas>
+ </clusterschemas>
+ <created_user>-</created_user>
+ <created_date>2023/10/20 11:20:34.675</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2023/10/20 11:20:34.675</modified_date>
+ <key_for_session_key/>
+ <is_key_private>N</is_key_private>
+ </info>
+ <notepads>
+ </notepads>
+ <connection>
+ <name>dw bi indoteknik (localhost)</name>
+ <server>localhost</server>
+ <type>POSTGRESQL</type>
+ <access>Native</access>
+ <database>dw_bi_indoteknik</database>
+ <port>5432</port>
+ <username>odoo</username>
+ <password>Encrypted 2be98afc82bdfd8dd9a2ca45acc83f6c3</password>
+ <servername/>
+ <data_tablespace/>
+ <index_tablespace/>
+ <attributes>
+ <attribute>
+ <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>IS_CLUSTERED</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>PORT_NUMBER</code>
+ <attribute>5432</attribute>
+ </attribute>
+ <attribute>
+ <code>PRESERVE_RESERVED_WORD_CASE</code>
+ <attribute>Y</attribute>
+ </attribute>
+ <attribute>
+ <code>QUOTE_ALL_FIELDS</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
+ <attribute>Y</attribute>
+ </attribute>
+ <attribute>
+ <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>USE_POOLING</code>
+ <attribute>N</attribute>
+ </attribute>
+ </attributes>
+ </connection>
+ <order>
+ <hop>
+ <from>Table input</from>
+ <to>Add constants</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Add constants</from>
+ <to>Filter rows</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Filter rows</from>
+ <to>Sort rows</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Sort rows</from>
+ <to>Merge join</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>month1</from>
+ <to>Merge join</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>month2</from>
+ <to>Merge join 2</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Merge join</from>
+ <to>Merge join 2</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Merge join 2</from>
+ <to>Merge join 3</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>month3</from>
+ <to>Merge join 3</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>month4</from>
+ <to>Merge join 4</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Merge join 3</from>
+ <to>Merge join 4</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>month5</from>
+ <to>Merge join 5</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Merge join 4</from>
+ <to>Merge join 5</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>month6</from>
+ <to>Merge join 6</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Merge join 5</from>
+ <to>Merge join 6</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Merge join 6</from>
+ <to>Select values</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Select values</from>
+ <to>If field value is null</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Filter rows</from>
+ <to>Select values 2</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Select values 2</from>
+ <to>Add constants 2</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>If field value is null</from>
+ <to>Append streams</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Add constants 2</from>
+ <to>Append streams</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Append streams</from>
+ <to>Add constants 3</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Add constants 3</from>
+ <to>Calculator</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Calculator</from>
+ <to>Select values 3</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Select values 3</from>
+ <to>Insert / update</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <step>
+ <name>Table input</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select viv.*, case when (now()::date-coalesce(viv.last_out::date, viv.last_in::date)) > 120 then 'dead' else 'good' end as status
+from v_inventory_value viv</sql>
+ <limit>0</limit>
+ <lookup/>
+ <execute_each_row>N</execute_each_row>
+ <variables_active>N</variables_active>
+ <lazy_conversion_active>N</lazy_conversion_active>
+ <cached_row_meta_active>N</cached_row_meta_active>
+ <row-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>Table input</origin>
+ <comments>product_id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>item_code</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>item_code</comments>
+ <conversion_Mask/>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>product</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>product</comments>
+ <conversion_Mask/>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Number</type>
+ <storagetype>normal</storagetype>
+ <name>sum</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>sum</comments>
+ <conversion_Mask>####0.0#########;-####0.0#########</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>value</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>value</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol/>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Date</type>
+ <storagetype>normal</storagetype>
+ <name>last_out</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>last_out</comments>
+ <conversion_Mask/>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Date</type>
+ <storagetype>normal</storagetype>
+ <name>last_in</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>last_in</comments>
+ <conversion_Mask/>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>brand</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>brand</comments>
+ <conversion_Mask/>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>status</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>status</comments>
+ <conversion_Mask/>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ </row-meta>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>144</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Add constants</name>
+ <type>Constant</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>constant_good</name>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>good</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>constant_dead</name>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>dead</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>272</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Filter rows</name>
+ <type>FilterRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <send_true_to>Sort rows</send_true_to>
+ <send_false_to>Select values 2</send_false_to>
+ <compare>
+ <condition>
+ <negated>N</negated>
+ <leftvalue>status</leftvalue>
+ <function>=</function>
+ <rightvalue>constant_good</rightvalue>
+ </condition>
+ </compare>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>416</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Sort rows</name>
+ <type>SortRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <directory>%%java.io.tmpdir%%</directory>
+ <prefix>out</prefix>
+ <sort_size>1000000</sort_size>
+ <free_memory/>
+ <compress>N</compress>
+ <compress_variable/>
+ <unique_rows>N</unique_rows>
+ <fields>
+ <field>
+ <name>product_id</name>
+ <ascending>Y</ascending>
+ <case_sensitive>N</case_sensitive>
+ <collator_enabled>N</collator_enabled>
+ <collator_strength>0</collator_strength>
+ <presorted>N</presorted>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>560</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Merge join</name>
+ <type>MergeJoin</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <join_type>LEFT OUTER</join_type>
+ <step1>Sort rows</step1>
+ <step2>month1</step2>
+ <keys_1>
+ <key>product_id</key>
+ </keys_1>
+ <keys_2>
+ <key>product_id</key>
+ </keys_2>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>656</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>month1</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select sm.product_id, sum(sm.product_uom_qty) as qty_month1, count(sm.product_id) as hit_month1,
+case when count(sm.product_id) > 0 then 1 else 0 end as month_count1
+from stock_move sm
+join stock_picking sp on sp.id = sm.picking_id
+where sp.state = 'done' and sp.name like '%OUT%'
+and sp.date_done >= (now()-'30 days'::interval)
+group by sm.product_id
+order by sm.product_id</sql>
+ <limit>0</limit>
+ <lookup/>
+ <execute_each_row>N</execute_each_row>
+ <variables_active>N</variables_active>
+ <lazy_conversion_active>N</lazy_conversion_active>
+ <cached_row_meta_active>N</cached_row_meta_active>
+ <row-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month1</origin>
+ <comments>product_id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>qty_month1</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>month1</origin>
+ <comments>qty_month1</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol/>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>hit_month1</name>
+ <length>15</length>
+ <precision>0</precision>
+ <origin>month1</origin>
+ <comments>hit_month1</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>month_count1</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month1</origin>
+ <comments>month_count1</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ </row-meta>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>656</xloc>
+ <yloc>16</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Merge join 2</name>
+ <type>MergeJoin</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <join_type>LEFT OUTER</join_type>
+ <step1>Merge join</step1>
+ <step2>month2</step2>
+ <keys_1>
+ <key>product_id</key>
+ </keys_1>
+ <keys_2>
+ <key>product_id</key>
+ </keys_2>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>768</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>month2</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select sm.product_id, sum(sm.product_uom_qty) as qty_month2, count(sm.product_id) as hit_month2,
+case when count(sm.product_id) > 0 then 1 else 0 end as month_count2
+from stock_move sm
+join stock_picking sp on sp.id = sm.picking_id
+where sp.state = 'done' and sp.name like '%OUT%'
+and sp.date_done >= (now()-'60 days'::interval)
+and sp.date_done &lt; (now()-'30 days'::interval)
+group by sm.product_id
+order by sm.product_id</sql>
+ <limit>0</limit>
+ <lookup/>
+ <execute_each_row>N</execute_each_row>
+ <variables_active>N</variables_active>
+ <lazy_conversion_active>N</lazy_conversion_active>
+ <cached_row_meta_active>N</cached_row_meta_active>
+ <row-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month2</origin>
+ <comments>product_id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>qty_month2</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>month2</origin>
+ <comments>qty_month2</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol/>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>hit_month2</name>
+ <length>15</length>
+ <precision>0</precision>
+ <origin>month2</origin>
+ <comments>hit_month2</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>month_count2</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month2</origin>
+ <comments>month_count2</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ </row-meta>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>768</xloc>
+ <yloc>16</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>month3</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select sm.product_id, sum(sm.product_uom_qty) as qty_month3, count(sm.product_id) as hit_month3,
+case when count(sm.product_id) > 0 then 1 else 0 end as month_count3
+from stock_move sm
+join stock_picking sp on sp.id = sm.picking_id
+where sp.state = 'done' and sp.name like '%OUT%'
+and sp.date_done >= (now()-'90 days'::interval)
+and sp.date_done &lt; (now()-'60 days'::interval)
+group by sm.product_id
+order by sm.product_id</sql>
+ <limit>0</limit>
+ <lookup/>
+ <execute_each_row>N</execute_each_row>
+ <variables_active>N</variables_active>
+ <lazy_conversion_active>N</lazy_conversion_active>
+ <cached_row_meta_active>N</cached_row_meta_active>
+ <row-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month3</origin>
+ <comments>product_id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>qty_month3</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>month3</origin>
+ <comments>qty_month3</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol/>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>hit_month3</name>
+ <length>15</length>
+ <precision>0</precision>
+ <origin>month3</origin>
+ <comments>hit_month3</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>month_count3</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month3</origin>
+ <comments>month_count3</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ </row-meta>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>880</xloc>
+ <yloc>16</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Merge join 3</name>
+ <type>MergeJoin</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <join_type>LEFT OUTER</join_type>
+ <step1>Merge join 2</step1>
+ <step2>month3</step2>
+ <keys_1>
+ <key>product_id</key>
+ </keys_1>
+ <keys_2>
+ <key>product_id</key>
+ </keys_2>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>880</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Merge join 4</name>
+ <type>MergeJoin</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <join_type>LEFT OUTER</join_type>
+ <step1>Merge join 3</step1>
+ <step2>month4</step2>
+ <keys_1>
+ <key>product_id</key>
+ </keys_1>
+ <keys_2>
+ <key>product_id</key>
+ </keys_2>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>1008</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>month4</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select sm.product_id, sum(sm.product_uom_qty) as qty_month4, count(sm.product_id) as hit_month4,
+case when count(sm.product_id) > 0 then 1 else 0 end as month_count4
+from stock_move sm
+join stock_picking sp on sp.id = sm.picking_id
+where sp.state = 'done' and sp.name like '%OUT%'
+and sp.date_done >= (now()-'120 days'::interval)
+and sp.date_done &lt; (now()-'90 days'::interval)
+group by sm.product_id
+order by sm.product_id</sql>
+ <limit>0</limit>
+ <lookup/>
+ <execute_each_row>N</execute_each_row>
+ <variables_active>N</variables_active>
+ <lazy_conversion_active>N</lazy_conversion_active>
+ <cached_row_meta_active>N</cached_row_meta_active>
+ <row-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month4</origin>
+ <comments>product_id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>qty_month4</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>month4</origin>
+ <comments>qty_month4</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol/>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>hit_month4</name>
+ <length>15</length>
+ <precision>0</precision>
+ <origin>month4</origin>
+ <comments>hit_month4</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>month_count4</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month4</origin>
+ <comments>month_count4</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ </row-meta>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>1008</xloc>
+ <yloc>16</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Merge join 5</name>
+ <type>MergeJoin</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <join_type>LEFT OUTER</join_type>
+ <step1>Merge join 4</step1>
+ <step2>month5</step2>
+ <keys_1>
+ <key>product_id</key>
+ </keys_1>
+ <keys_2>
+ <key>product_id</key>
+ </keys_2>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>1120</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>month5</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select sm.product_id, sum(sm.product_uom_qty) as qty_month5, count(sm.product_id) as hit_month5,
+case when count(sm.product_id) > 0 then 1 else 0 end as month_count5
+from stock_move sm
+join stock_picking sp on sp.id = sm.picking_id
+where sp.state = 'done' and sp.name like '%OUT%'
+and sp.date_done >= (now()-'150 days'::interval)
+and sp.date_done &lt; (now()-'120 days'::interval)
+group by sm.product_id
+order by sm.product_id</sql>
+ <limit>0</limit>
+ <lookup/>
+ <execute_each_row>N</execute_each_row>
+ <variables_active>N</variables_active>
+ <lazy_conversion_active>N</lazy_conversion_active>
+ <cached_row_meta_active>N</cached_row_meta_active>
+ <row-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month5</origin>
+ <comments>product_id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>qty_month5</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>month5</origin>
+ <comments>qty_month5</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol/>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>hit_month5</name>
+ <length>15</length>
+ <precision>0</precision>
+ <origin>month5</origin>
+ <comments>hit_month5</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>month_count5</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month5</origin>
+ <comments>month_count5</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ </row-meta>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>1120</xloc>
+ <yloc>16</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>month6</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select sm.product_id, sum(sm.product_uom_qty) as qty_month6, count(sm.product_id) as hit_month6,
+case when count(sm.product_id) > 0 then 1 else 0 end as month_count6
+from stock_move sm
+join stock_picking sp on sp.id = sm.picking_id
+where sp.state = 'done' and sp.name like '%OUT%'
+and sp.date_done >= (now()-'180 days'::interval)
+and sp.date_done &lt; (now()-'150 days'::interval)
+group by sm.product_id
+order by sm.product_id</sql>
+ <limit>0</limit>
+ <lookup/>
+ <execute_each_row>N</execute_each_row>
+ <variables_active>N</variables_active>
+ <lazy_conversion_active>N</lazy_conversion_active>
+ <cached_row_meta_active>N</cached_row_meta_active>
+ <row-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month6</origin>
+ <comments>product_id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>qty_month6</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>month6</origin>
+ <comments>qty_month6</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol/>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>hit_month6</name>
+ <length>15</length>
+ <precision>0</precision>
+ <origin>month6</origin>
+ <comments>hit_month6</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>month_count6</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>month6</origin>
+ <comments>month_count6</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
+ </row-meta>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>1232</xloc>
+ <yloc>16</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Merge join 6</name>
+ <type>MergeJoin</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <join_type>LEFT OUTER</join_type>
+ <step1>Merge join 5</step1>
+ <step2>month6</step2>
+ <keys_1>
+ <key>product_id</key>
+ </keys_1>
+ <keys_2>
+ <key>product_id</key>
+ </keys_2>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>1232</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Select values</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>product_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>item_code</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product</name>
+ <rename/>
+ </field>
+ <field>
+ <name>sum</name>
+ <rename/>
+ </field>
+ <field>
+ <name>value</name>
+ <rename/>
+ </field>
+ <field>
+ <name>last_out</name>
+ <rename/>
+ </field>
+ <field>
+ <name>last_in</name>
+ <rename/>
+ </field>
+ <field>
+ <name>brand</name>
+ <rename/>
+ </field>
+ <field>
+ <name>status</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month2</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month3</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month4</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month5</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month6</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month2</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month3</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month4</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month5</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month6</name>
+ <rename/>
+ </field>
+ <field>
+ <name>month_count1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>month_count2</name>
+ <rename/>
+ </field>
+ <field>
+ <name>month_count3</name>
+ <rename/>
+ </field>
+ <field>
+ <name>month_count4</name>
+ <rename/>
+ </field>
+ <field>
+ <name>month_count5</name>
+ <rename/>
+ </field>
+ <field>
+ <name>month_count6</name>
+ <rename/>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ <meta>
+ <name>product_id</name>
+ <rename>product_id</rename>
+ <type>None</type>
+ <length>9</length>
+ <precision>0</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>item_code</name>
+ <rename>item_code</rename>
+ <type>None</type>
+ <length>2147483647</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>product</name>
+ <rename>product</rename>
+ <type>None</type>
+ <length>2147483647</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>sum</name>
+ <rename>sum</rename>
+ <type>None</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>value</name>
+ <rename>value</rename>
+ <type>None</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>last_out</name>
+ <rename>last_out</rename>
+ <type>None</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>last_in</name>
+ <rename>last_in</rename>
+ <type>None</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>brand</name>
+ <rename>brand</rename>
+ <type>None</type>
+ <length>2147483647</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>status</name>
+ <rename>status</rename>
+ <type>None</type>
+ <length>2147483647</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>qty_month1</name>
+ <rename>qty_month1</rename>
+ <type>Number</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>qty_month2</name>
+ <rename>qty_month2</rename>
+ <type>Number</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>qty_month3</name>
+ <rename>qty_month3</rename>
+ <type>Number</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>qty_month4</name>
+ <rename>qty_month4</rename>
+ <type>Number</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>qty_month5</name>
+ <rename>qty_month5</rename>
+ <type>Number</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>qty_month6</name>
+ <rename>qty_month6</rename>
+ <type>Number</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>hit_month1</name>
+ <rename>hit_month1</rename>
+ <type>Number</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>hit_month2</name>
+ <rename>hit_month2</rename>
+ <type>Number</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>hit_month3</name>
+ <rename>hit_month3</rename>
+ <type>Number</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>hit_month4</name>
+ <rename>hit_month4</rename>
+ <type>Number</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>hit_month5</name>
+ <rename>hit_month5</rename>
+ <type>Number</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>hit_month6</name>
+ <rename>hit_month6</rename>
+ <type>Number</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>month_count1</name>
+ <rename>month_count1</rename>
+ <type>Number</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>month_count2</name>
+ <rename>month_count2</rename>
+ <type>Number</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>month_count3</name>
+ <rename>month_count3</rename>
+ <type>Number</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>month_count4</name>
+ <rename>month_count4</rename>
+ <type>Number</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>month_count5</name>
+ <rename>month_count5</rename>
+ <type>Number</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>month_count6</name>
+ <rename>month_count6</rename>
+ <type>Number</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>1232</xloc>
+ <yloc>208</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>If field value is null</name>
+ <type>IfNull</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <replaceAllByValue>0</replaceAllByValue>
+ <replaceAllMask/>
+ <selectFields>Y</selectFields>
+ <selectValuesType>N</selectValuesType>
+ <setEmptyStringAll>N</setEmptyStringAll>
+ <valuetypes>
+ </valuetypes>
+ <fields>
+ <field>
+ <name>qty_month1</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month2</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month3</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month4</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month5</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month6</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month1</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month2</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month3</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month4</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month5</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month6</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count1</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count2</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count3</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count4</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count5</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count6</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>1120</xloc>
+ <yloc>208</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Append streams</name>
+ <type>Append</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <head_name>If field value is null</head_name>
+ <tail_name>Add constants 2</tail_name>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>768</xloc>
+ <yloc>208</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Select values 2</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>product_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>item_code</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product</name>
+ <rename/>
+ </field>
+ <field>
+ <name>sum</name>
+ <rename/>
+ </field>
+ <field>
+ <name>value</name>
+ <rename/>
+ </field>
+ <field>
+ <name>last_out</name>
+ <rename/>
+ </field>
+ <field>
+ <name>last_in</name>
+ <rename/>
+ </field>
+ <field>
+ <name>brand</name>
+ <rename/>
+ </field>
+ <field>
+ <name>status</name>
+ <rename/>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>416</xloc>
+ <yloc>208</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Add constants 2</name>
+ <type>Constant</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>qty_month1</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month2</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month3</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month4</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month5</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>qty_month6</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month1</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month2</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month3</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month4</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month5</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>hit_month6</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count1</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count2</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count3</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count4</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count5</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ <field>
+ <name>month_count6</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>0</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>560</xloc>
+ <yloc>208</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Add constants 3</name>
+ <type>Constant</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>diff_month</name>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>6</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>768</xloc>
+ <yloc>304</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Calculator</name>
+ <type>Calculator</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <failIfNoFile>Y</failIfNoFile>
+ <calculation>
+ <field_name>sum_hit1</field_name>
+ <calc_type>ADD3</calc_type>
+ <field_a>hit_month1</field_a>
+ <field_b>hit_month2</field_b>
+ <field_c>hit_month3</field_c>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <calculation>
+ <field_name>sum_hit2</field_name>
+ <calc_type>ADD3</calc_type>
+ <field_a>hit_month4</field_a>
+ <field_b>hit_month5</field_b>
+ <field_c>hit_month6</field_c>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <calculation>
+ <field_name>total_hit</field_name>
+ <calc_type>ADD</calc_type>
+ <field_a>sum_hit1</field_a>
+ <field_b>sum_hit2</field_b>
+ <field_c/>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <calculation>
+ <field_name>avg_per_month</field_name>
+ <calc_type>DIVIDE</calc_type>
+ <field_a>total_hit</field_a>
+ <field_b>diff_month</field_b>
+ <field_c/>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <calculation>
+ <field_name>sum_mc1</field_name>
+ <calc_type>ADD3</calc_type>
+ <field_a>month_count1</field_a>
+ <field_b>month_count2</field_b>
+ <field_c>month_count3</field_c>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <calculation>
+ <field_name>sum_mc2</field_name>
+ <calc_type>ADD3</calc_type>
+ <field_a>month_count4</field_a>
+ <field_b>month_count5</field_b>
+ <field_c>month_count6</field_c>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <calculation>
+ <field_name>total_mc</field_name>
+ <calc_type>ADD</calc_type>
+ <field_a>sum_mc1</field_a>
+ <field_b>sum_mc2</field_b>
+ <field_c/>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>880</xloc>
+ <yloc>304</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Select values 3</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>product_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>item_code</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product</name>
+ <rename/>
+ </field>
+ <field>
+ <name>sum</name>
+ <rename>onhand</rename>
+ </field>
+ <field>
+ <name>value</name>
+ <rename/>
+ </field>
+ <field>
+ <name>last_out</name>
+ <rename/>
+ </field>
+ <field>
+ <name>last_in</name>
+ <rename/>
+ </field>
+ <field>
+ <name>brand</name>
+ <rename/>
+ </field>
+ <field>
+ <name>status</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month2</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month3</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month4</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month5</name>
+ <rename/>
+ </field>
+ <field>
+ <name>qty_month6</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month2</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month3</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month4</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month5</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hit_month6</name>
+ <rename/>
+ </field>
+ <field>
+ <name>total_hit</name>
+ <rename/>
+ </field>
+ <field>
+ <name>avg_per_month</name>
+ <rename/>
+ </field>
+ <field>
+ <name>total_mc</name>
+ <rename/>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>992</xloc>
+ <yloc>304</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Insert / update</name>
+ <type>InsertUpdate</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <commit>100</commit>
+ <update_bypassed>N</update_bypassed>
+ <lookup>
+ <schema>public</schema>
+ <table>inventory_compute</table>
+ <key>
+ <name>product_id</name>
+ <field>product_id</field>
+ <condition>=</condition>
+ <name2/>
+ </key>
+ <value>
+ <name>product_id</name>
+ <rename>product_id</rename>
+ <update>N</update>
+ </value>
+ <value>
+ <name>item_code</name>
+ <rename>item_code</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>product</name>
+ <rename>product</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>onhand</name>
+ <rename>onhand</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>value</name>
+ <rename>value</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>last_out</name>
+ <rename>last_out</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>last_in</name>
+ <rename>last_in</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>brand</name>
+ <rename>brand</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>status</name>
+ <rename>status</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>qty_month1</name>
+ <rename>qty_month1</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>qty_month2</name>
+ <rename>qty_month2</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>qty_month3</name>
+ <rename>qty_month3</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>qty_month4</name>
+ <rename>qty_month4</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>qty_month5</name>
+ <rename>qty_month5</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>qty_month6</name>
+ <rename>qty_month6</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>hit_month1</name>
+ <rename>hit_month1</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>hit_month2</name>
+ <rename>hit_month2</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>hit_month3</name>
+ <rename>hit_month3</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>hit_month4</name>
+ <rename>hit_month4</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>hit_month5</name>
+ <rename>hit_month5</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>hit_month6</name>
+ <rename>hit_month6</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>total_hit</name>
+ <rename>total_hit</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>avg_per_month</name>
+ <rename>avg_per_month</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>total_mc</name>
+ <rename>total_mc</rename>
+ <update>Y</update>
+ </value>
+ </lookup>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>1120</xloc>
+ <yloc>304</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step_error_handling>
+ </step_error_handling>
+ <slave-step-copy-partition-distribution>
+ </slave-step-copy-partition-distribution>
+ <slave_transformation>N</slave_transformation>
+ <attributes/>
+</transformation>
diff --git a/import_delivery_order.kjb b/import_delivery_order.kjb
index d94670c..e46301a 100644
--- a/import_delivery_order.kjb
+++ b/import_delivery_order.kjb
@@ -503,6 +503,45 @@
<yloc>96</yloc>
<attributes_kjc/>
</entry>
+ <entry>
+ <name>calculate_inventory</name>
+ <description/>
+ <type>TRANS</type>
+ <attributes/>
+ <specification_method>filename</specification_method>
+ <trans_object_id/>
+ <filename>/home/stephan/transformation-job-bi/calculate_inventory.ktr</filename>
+ <transname/>
+ <arg_from_previous>N</arg_from_previous>
+ <params_from_previous>N</params_from_previous>
+ <exec_per_row>N</exec_per_row>
+ <clear_rows>N</clear_rows>
+ <clear_files>N</clear_files>
+ <set_logfile>N</set_logfile>
+ <logfile/>
+ <logext/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <loglevel>Basic</loglevel>
+ <cluster>N</cluster>
+ <slave_server_name/>
+ <set_append_logfile>N</set_append_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <follow_abort_remote>N</follow_abort_remote>
+ <create_parent_folder>N</create_parent_folder>
+ <logging_remote_work>N</logging_remote_work>
+ <run_configuration>Pentaho local</run_configuration>
+ <suppress_result_data>N</suppress_result_data>
+ <parameters>
+ <pass_all_parameters>Y</pass_all_parameters>
+ </parameters>
+ <parallel>N</parallel>
+ <draw>Y</draw>
+ <nr>0</nr>
+ <xloc>896</xloc>
+ <yloc>96</yloc>
+ <attributes_kjc/>
+ </entry>
</entries>
<hops>
<hop>
@@ -550,6 +589,15 @@
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
+ <hop>
+ <from>stock_valuation</from>
+ <to>calculate_inventory</to>
+ <from_nr>0</from_nr>
+ <to_nr>0</to_nr>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
</hops>
<notepads>
</notepads>
diff --git a/import_stock_location.ktr b/import_stock_location.ktr
index 84bfc09..8e21351 100644
--- a/import_stock_location.ktr
+++ b/import_stock_location.ktr
@@ -430,7 +430,7 @@
<created_date>2023/10/20 10:43:20.923</created_date>
<modified_user>-</modified_user>
<modified_date>2023/10/20 10:43:20.923</modified_date>
- <key_for_session_key/>
+ <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
@@ -545,6 +545,154 @@
</hop>
</order>
<step>
+ <name>Insert / update</name>
+ <type>InsertUpdate</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <commit>100</commit>
+ <update_bypassed>N</update_bypassed>
+ <lookup>
+ <schema>public</schema>
+ <table>stock_location</table>
+ <key>
+ <name>id</name>
+ <field>id</field>
+ <condition>=</condition>
+ <name2/>
+ </key>
+ <value>
+ <name>id</name>
+ <rename>id</rename>
+ <update>N</update>
+ </value>
+ <value>
+ <name>name</name>
+ <rename>name</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>complete_name</name>
+ <rename>complete_name</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>active</name>
+ <rename>active</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>usage</name>
+ <rename>usage</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>location_id</name>
+ <rename>location_id</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>comment</name>
+ <rename>comment</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>posx</name>
+ <rename>posx</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>posy</name>
+ <rename>posy</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>posz</name>
+ <rename>posz</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>parent_path</name>
+ <rename>parent_path</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>company_id</name>
+ <rename>company_id</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>scrap_location</name>
+ <rename>scrap_location</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>return_location</name>
+ <rename>return_location</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>removal_strategy_id</name>
+ <rename>removal_strategy_id</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>barcode</name>
+ <rename>barcode</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>create_uid</name>
+ <rename>create_uid</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>create_date</name>
+ <rename>create_date</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>write_uid</name>
+ <rename>write_uid</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>write_date</name>
+ <rename>write_date</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>valuation_in_account_id</name>
+ <rename>valuation_in_account_id</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>valuation_out_account_id</name>
+ <rename>valuation_out_account_id</rename>
+ <update>Y</update>
+ </value>
+ </lookup>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>320</xloc>
+ <yloc>48</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
<name>Table input</name>
<type>TableInput</type>
<description/>
@@ -1085,154 +1233,6 @@
<draw>Y</draw>
</GUI>
</step>
- <step>
- <name>Insert / update</name>
- <type>InsertUpdate</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <connection>dw bi indoteknik (localhost)</connection>
- <commit>100</commit>
- <update_bypassed>N</update_bypassed>
- <lookup>
- <schema>public</schema>
- <table>stock_location</table>
- <key>
- <name>id</name>
- <field>id</field>
- <condition>=</condition>
- <name2/>
- </key>
- <value>
- <name>id</name>
- <rename>id</rename>
- <update>N</update>
- </value>
- <value>
- <name>name</name>
- <rename>name</rename>
- <update>Y</update>
- </value>
- <value>
- <name>complete_name</name>
- <rename>complete_name</rename>
- <update>Y</update>
- </value>
- <value>
- <name>active</name>
- <rename>active</rename>
- <update>Y</update>
- </value>
- <value>
- <name>usage</name>
- <rename>usage</rename>
- <update>Y</update>
- </value>
- <value>
- <name>location_id</name>
- <rename>location_id</rename>
- <update>Y</update>
- </value>
- <value>
- <name>comment</name>
- <rename>comment</rename>
- <update>Y</update>
- </value>
- <value>
- <name>posx</name>
- <rename>posx</rename>
- <update>Y</update>
- </value>
- <value>
- <name>posy</name>
- <rename>posy</rename>
- <update>Y</update>
- </value>
- <value>
- <name>posz</name>
- <rename>posz</rename>
- <update>Y</update>
- </value>
- <value>
- <name>parent_path</name>
- <rename>parent_path</rename>
- <update>Y</update>
- </value>
- <value>
- <name>company_id</name>
- <rename>company_id</rename>
- <update>Y</update>
- </value>
- <value>
- <name>scrap_location</name>
- <rename>scrap_location</rename>
- <update>Y</update>
- </value>
- <value>
- <name>return_location</name>
- <rename>return_location</rename>
- <update>Y</update>
- </value>
- <value>
- <name>removal_strategy_id</name>
- <rename>removal_strategy_id</rename>
- <update>Y</update>
- </value>
- <value>
- <name>barcode</name>
- <rename>barcode</rename>
- <update>Y</update>
- </value>
- <value>
- <name>create_uid</name>
- <rename>create_uid</rename>
- <update>Y</update>
- </value>
- <value>
- <name>create_date</name>
- <rename>create_date</rename>
- <update>Y</update>
- </value>
- <value>
- <name>write_uid</name>
- <rename>write_uid</rename>
- <update>Y</update>
- </value>
- <value>
- <name>write_date</name>
- <rename>write_date</rename>
- <update>Y</update>
- </value>
- <value>
- <name>valuation_in_account_id</name>
- <rename>valuation_in_account_id</rename>
- <update>Y</update>
- </value>
- <value>
- <name>valuation_out_account_id</name>
- <rename>valuation_out_account_id</rename>
- <update>Y</update>
- </value>
- </lookup>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>320</xloc>
- <yloc>48</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>