Classify orders with the ordered products

DaHummaDaHumma Member Posts: 2 Newbie
edited June 2020 in Help
Hey guys,

I'm new here and I have a little problem. I have a set of data where the UserID, the order number, the ordered articles and the articles gender (female, male, unisex). I want to see, for which gender the user buys products. Because i have one column per article, i want to compare the genders of those articles in the matching order number and generate a new attribute in which the whole order number get's the most bought gender in this order for the whole order number.
I tried to aggregate the order numbers and count the amount, a specific gender is in that order. 
Now the problem is, how to generate the attributes, that match the order number, maybe you guys can help me?

Here is an example for the table:

UserID; ordernumber; article; gender

a; 10; 1234; female
a; 10; 1233; female
a; 10; 1245; unisex
b; 11; 1324; male
c; 12; 1324; male
c; 12; 1325; male
c; 12; 1223; female
d; 13; 1234; female
d; 12; 1245; unisex

Best Answer


  • Options
    DaHummaDaHumma Member Posts: 2 Newbie
    edited June 2020
    Here's my xml description up until now:
    <?xml version="1.0" encoding="UTF-8"?><process version="9.7.000">
      <operator activated="true" class="process" compatibility="9.7.000" expanded="true" name="Process">
        <parameter key="logverbosity" value="init"/>
        <parameter key="random_seed" value="2001"/>
        <parameter key="send_mail" value="never"/>
        <parameter key="notification_email" value=""/>
        <parameter key="process_duration_for_mail" value="30"/>
        <parameter key="encoding" value="SYSTEM"/>
        <process expanded="true">
          <operator activated="true" class="productivity:execute_process" compatibility="9.7.000" expanded="true" height="82" name="Execute join_1" width="90" x="45" y="34">
            <parameter key="process_location" value="//Local Repository/processes/join_1"/>
            <parameter key="use_input" value="true"/>
            <parameter key="store_output" value="false"/>
            <parameter key="propagate_metadata_recursively" value="true"/>
            <parameter key="cache_process" value="true"/>
            <list key="macros"/>
            <parameter key="fail_for_unknown_macros" value="true"/>
          <operator activated="true" class="filter_examples" compatibility="9.7.000" expanded="true" height="103" name="Filter Examples" width="90" x="246" y="34">
            <parameter key="parameter_expression" value=""/>
            <parameter key="condition_class" value="custom_filters"/>
            <parameter key="invert_filter" value="false"/>
            <list key="filters_list">
              <parameter key="filters_entry_key" value="brl_geschlecht.does_not_equal.0"/>
              <parameter key="filters_entry_key" value="brl_geschlecht.is_not_missing."/>
            <parameter key="filters_logic_and" value="true"/>
            <parameter key="filters_check_metadata" value="true"/>
          <operator activated="true" class="aggregate" compatibility="9.7.000" expanded="true" height="82" name="Aggregate" width="90" x="514" y="34">
            <parameter key="use_default_aggregation" value="false"/>
            <parameter key="attribute_filter_type" value="all"/>
            <parameter key="attribute" value=""/>
            <parameter key="attributes" value=""/>
            <parameter key="use_except_expression" value="false"/>
            <parameter key="value_type" value="attribute_value"/>
            <parameter key="use_value_type_exception" value="false"/>
            <parameter key="except_value_type" value="time"/>
            <parameter key="block_type" value="attribute_block"/>
            <parameter key="use_block_type_exception" value="false"/>
            <parameter key="except_block_type" value="value_matrix_row_start"/>
            <parameter key="invert_selection" value="false"/>
            <parameter key="include_special_attributes" value="false"/>
            <parameter key="default_aggregation_function" value="average"/>
            <list key="aggregation_attributes">
              <parameter key="brl_geschlecht" value="count"/>
            <parameter key="group_by_attributes" value="userid|ordernumber|brl_geschlecht"/>
            <parameter key="count_all_combinations" value="false"/>
            <parameter key="only_distinct" value="false"/>
            <parameter key="ignore_missings" value="true"/>
          <connect from_port="input 1" to_op="Execute join_1" to_port="input 1"/>
          <connect from_op="Execute join_1" from_port="result 1" to_op="Filter Examples" to_port="example set input"/>
          <connect from_op="Filter Examples" from_port="example set output" to_op="Aggregate" to_port="example set input"/>
          <connect from_op="Aggregate" from_port="example set output" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="source_input 2" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>

Sign In or Register to comment.