The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

what is wrong in this function?

cdapontecdaponte Member Posts: 29 Maven
 Is very general the question, but maybe you can answer it. Thanks!

if(Tercerizado==0 && "Prodcuto Generico"=="PV" && [Vector de Mora Reducido]>3,"MORA TARDIA-PV",
if(Tercerizado==0 && contains("Prodcuto Generico","CBU-NO") &&[Vector de Mora Reducido]>3 ,"MORA TARDIA-CBU-NO BARRIDO",
if(Tercerizado==0 && contains("Prodcuto Generico","CBU-BA") && [Vector de Mora Reducido]==4,4,
if(Tercerizado==0 && contains("Prodcuto Generico","CBU-BA") && [Vector de Mora Reducido]==5,5,
if(Tercerizado==0 && contains("Prodcuto Generico","CBU-BA") && [Vector de Mora Reducido]>5,"MAS DE 5"," ")))))

Best Answer

Answers

  • cdapontecdaponte Member Posts: 29 Maven
    I´m executing it but it does not give me any result! And i don´t know why. I getting crazy!
  • varunm1varunm1 Member Posts: 1,207 Unicorn
    Can you inform what type of attributes are (Tercerizado, Prodcuto Generico and Vector de Mora Reducido)? By type, I mean whether they are text or polynomial or number or any other?

    Also, can you share your XML process and sample dataset?
    Regards,
    Varun
    https://www.varunmandalapu.com/

    Be Safe. Follow precautions and Maintain Social Distancing

  • cdapontecdaponte Member Posts: 29 Maven
    Tercerizado is nominal, Producto generico Polynominal and Vector de Mora Reducido is integer.

    <?xml version="1.0" encoding="UTF-8"?><process version="9.3.001">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="9.3.001" 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="false" class="generate_attributes" compatibility="9.3.001" expanded="true" height="82" name="Generate Attributes (2)" width="90" x="179" y="238">
            <list key="function_descriptions">
              <parameter key="asd" value="if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;PV&quot;&amp;&amp;[Vector de Mora Reducido]&gt;3,&quot;MORA TARDIA-PV&quot;,&#13;&#10;if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;CBU-NO BARRIDO&quot;&amp;&amp;[Vector de Mora Reducido]&gt;3,&quot;MORA TARDIA-CBU-NO BARRIDO&quot;,&#13;&#10;if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;CBU-BARRIDO&quot; &amp;&amp; &quot;Vector de Mora Reducido&quot;==4,4,&#13;&#10;if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;CBU-BARRIDO&quot; &amp;&amp; &quot;Vector de Mora Reducido&quot;==5,5,&#13;&#10;if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;CBU-BARRIDO&quot; &amp;&amp; [Vector de Mora Reducido]&gt;5,&quot;MAS DE 5&quot;,&quot; &quot; )))))"/>
            </list>
            <parameter key="keep_all" value="true"/>
          </operator>
          <operator activated="false" class="select_attributes" compatibility="9.3.001" expanded="true" height="82" name="Select Attributes" width="90" x="514" y="187">
            <parameter key="attribute_filter_type" value="subset"/>
            <parameter key="attribute" value=""/>
            <parameter key="attributes" value="Tercerizado|Vector de Mora Reducido|Vector de Mora Real|Producto Generico"/>
            <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"/>
          </operator>
          <operator activated="true" class="retrieve" compatibility="9.3.001" expanded="true" height="68" name="Retrieve 1.BASE REAL ENRIQUECIDA UNIDA" width="90" x="45" y="34">
            <parameter key="repository_entry" value="../data/Data Base Real/1.BASE REAL ENRIQUECIDA UNIDA"/>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="9.3.001" expanded="true" height="82" name="Generate Attributes" width="90" x="179" y="136">
            <list key="function_descriptions">
              <parameter key="Vector de Mora Reducido" value="if([Vector Mora]== 0,0,&#10;if([Vector Mora]== 1 ,1,&#10;if([Vector Mora]== 2,2,&#10;if([Vector Mora]==3,3,&#10;if([Vector Mora]==4,4,&#10;if([Vector Mora]==5,5,6))))))"/>
              <parameter key="Vector de Mora Real" value="if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;PV&quot;&amp;&amp;[Vector de Mora Reducido]&gt;3,&quot;MORA TARDIA-PV&quot;,&#10;if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;CBU-NO BARRIDO&quot;&amp;&amp;[Vector de Mora Reducido]&gt;3,&quot;MORA TARDIA-CBU-NO BARRIDO&quot;,&#10;if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;CBU-BARRIDO&quot; &amp;&amp; &quot;Vector de Mora Reducido&quot;==4,4,&#10;if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;CBU-BARRIDO&quot; &amp;&amp; &quot;Vector de Mora Reducido&quot;==5,5,&#10;if(missing(Tercerizado) &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;CBU-BARRIDO&quot; &amp;&amp; [Vector de Mora Reducido]&gt;5,&quot;MAS DE 5&quot;,&#10;if(missing(Tercerizado) &amp;&amp; [Vector Mora]== 0,0,&#10;if(missing(Tercerizado) &amp;&amp; [Vector Mora]==1,1,&#10;if(missing(Tercerizado) &amp;&amp; [Vector Mora]==2,2,&#10;if(missing(Tercerizado) &amp;&amp; [Vector Mora]==3,3,&#10;if(missing(Tercerizado) &amp;&amp; [Vector Mora]==4,4,&#10;if(missing(Tercerizado) &amp;&amp; [Vector Mora]==5,5,&#10;if(&quot;Producto Generico&quot;==&quot;CBU-BARRIDO&quot; &amp;&amp; Tercerizado==&quot;MORA TARDIA&quot;,&quot;MAS DE 5&quot;,&#10;if(&quot;Producto Generico&quot;==&quot;CBU-BARRIDO&quot; &amp;&amp; missing(Tercerizado) &amp;&amp; [Vector Mora]&gt;5 ,&quot;MAS DE 5&quot;,&#10;if(contains(Tercerizado,&quot;WEISFELD&quot;)||contains(Tercerizado,&quot;QUIEBRA&quot;)||contains(Tercerizado,&quot;Weisfeld&quot;)||contains(Tercerizado,&quot;LLECI&quot;)||contains(Tercerizado,&quot;SAGUES&quot;)||contains(Tercerizado,&quot;HADAD&quot;) ||equals(Tercerizado,&quot;JUDICIAL&quot;)||equals(Tercerizado,&quot;GESPO JUDICIAL&quot;)||equals(Tercerizado,&quot;GLUPO JUDICIAL&quot;)||equals(Tercerizado,&quot;Judicial&quot;) ,&quot;ESTUDIO JUDICIAL&quot;,&#10;if(Tercerizado==&quot;MORA TARDIA&quot; &amp;&amp; &quot;Producto Generico&quot;==&quot;PV&quot;, &quot;MORA TARDIA-PV&quot;,&#10;if(Tercerizado==&quot;MORA TARDIA&quot; &amp;&amp; &quot;Producto Generico&quot;==&quot;CBU-NO BARRIDO&quot;,&quot;MORA TARDIA- CBU-NO BARRIDO&quot;,&#10;if(contains(Tercerizado,&quot;COBRO&quot;),&quot;ARGENCOBRO&quot;,&#10;&quot;ESTUDIO EXTRAJUDICIAL&quot;)))))))))))))))))"/>
              <parameter key="Producto" value="if(&quot;Producto Generico&quot;==&quot;PV&quot;,&quot;PV&quot;,&#10;if(&quot;Producto Generico&quot;==&quot;Codigo&quot;,&quot;Codigo&quot;,&#10;if(contains(Plan,&quot;NACION&quot;)||contains(Plan, &quot;NACIÓN&quot;),&quot;CBU-BCO NACION&quot;,&#10;if(contains(Plan,&quot;CHUBUT&quot;),&quot;CBU-BCO CHUBUT&quot;,&#10;if(contains(Plan,&quot;PATAGONIA&quot;),&quot;CBU-BCO PATAGONIA&quot;,&#10;if(contains(Plan,&quot;NEUQUEN&quot;) ||contains(Plan, &quot;NEUQUÉN&quot;),&quot;CBU-BCO NEUQUEN&quot;,&#10;if(contains(Plan,&quot;CORDOBA&quot;),&quot;CBU-BCO CORDOBA&quot;,&#10;if(&quot;Producto Generico&quot; == &quot;CODIGO&quot;,&quot;CODIGO&quot;,&#10;if(&quot;Producto Generico&quot; == &quot;PV&quot;,&quot;PV&quot;,&#10;if(contains(Plan,&quot;PROVINCIA&quot;),&quot;CBU-BCO PROVINCIA&quot;,&#10;if(contains(Plan,&quot;CIUDAD&quot;),&quot;CBU-BCO CIUDAD&quot;,&#10;if(contains(Plan,&quot;SINAPA&quot;)||contains(Plan,&quot;FC&quot;) ||contains(Plan,&quot;FI&quot;),&quot;SINAPA&quot;,&#10;if(contains(Plan,&quot;VERAZ&quot;),&quot;VERAZ&quot;,&#10;if(contains(Plan,&quot;GALICIA&quot;),&quot;CBU-BCO GALICIA&quot;,&#10;if(contains(Plan,&quot;SANTANDER&quot;),&quot;CBU-BCO SANTANDER&quot;,&#10;if(contains(Plan,&quot;CAMARA&quot;),&quot;CAMARA&quot;,&#10;if(contains(Plan,&quot;CBU BENEF SIN MOV&quot;),&quot;CBU BENEF SIN MOV&quot;,&#10;&quot; &quot;)))))))))))))))))"/>
              <parameter key="Producto Generico" value="if(contains(Plan, &quot;NEUQUEN&quot;)||contains(Plan, &quot;NEUQUÉN&quot;),&quot;CBU-BARRIDO&quot;,&#10;if(contains(Plan, &quot;CORDOBA&quot;),&quot;CBU-BARRIDO&quot;,&#10;if(contains(Plan,&quot;PATAGONIA&quot;),&quot;CBU-BARRIDO&quot;,&#10;if(contains(Plan,&quot;CHUBUT&quot;),&quot;CBU-BARRIDO&quot;,&#10;if(contains(Plan,&quot;NACION&quot;)||contains(Plan, &quot;NACIÓN&quot;),&quot;CBU-BARRIDO&quot;,&#10;if(starts(Plan,&quot;CBU&quot;),&quot;CBU-NO BARRIDO&quot;,&#10;if(starts(Plan,&quot;SINAPA&quot;),&quot;CBU-NO BARRIDO&quot;, &#10;if(contains(Plan,&quot;CAMARA&quot;),&quot;CBU-NO BARRIDO&quot;,&#10;if(contains(Plan,&quot;Dirigido CBU&quot;),&quot;CBU-NO BARRIDO&quot;,&#10;if(matches(Plan,&quot;VERAZ 500&quot;),&quot;CBU-NO BARRIDO&quot;,&#10;if(contains(Plan,&quot;FC&quot;) ||contains(Plan,&quot;FI&quot;),&quot;CBU-NO BARRIDO&quot;,&#10;if(contains(Plan,&quot;Codigo&quot;),&quot;CODIGO&quot;,&quot;PV&quot;))))))))))))"/>
            </list>
            <parameter key="keep_all" value="true"/>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="9.3.001" expanded="true" height="82" name="Generate Attributes (4)" width="90" x="313" y="136">
            <list key="function_descriptions">
              <parameter key="asdd" value="if(Tercerizado==0 &amp;&amp; &quot;Prodcuto Generico&quot;==&quot;PV&quot; &amp;&amp; [Vector de Mora Reducido]&gt;3,&quot;MORA TARDIA-PV&quot;,&#13;&#10;if(Tercerizado==0 &amp;&amp; contains(&quot;Prodcuto Generico&quot;,&quot;CBU-NO&quot;) &amp;&amp;[Vector de Mora Reducido]&gt;3 ,&quot;MORA TARDIA-CBU-NO BARRIDO&quot;,&#13;&#10;if(Tercerizado==0 &amp;&amp; contains(&quot;Prodcuto Generico&quot;,&quot;CBU-BA&quot;) &amp;&amp; [Vector de Mora Reducido]==4,4,&#13;&#10;if(Tercerizado==0 &amp;&amp; contains(&quot;Prodcuto Generico&quot;,&quot;CBU-BA&quot;) &amp;&amp; [Vector de Mora Reducido]==5,5,&#13;&#10;if(Tercerizado==0 &amp;&amp; contains(&quot;Prodcuto Generico&quot;,&quot;CBU-BA&quot;) &amp;&amp; [Vector de Mora Reducido]&gt;5,&quot;MAS DE 5&quot;,&quot; &quot;)))))"/>
            </list>
            <parameter key="keep_all" value="true"/>
          </operator>
          <operator activated="false" class="generate_attributes" compatibility="9.3.001" expanded="true" height="82" name="Generate Attributes (3)" width="90" x="313" y="34">
            <list key="function_descriptions">
              <parameter key="Diferencia mes" value="round(date_diff([F. Ult. Pago],Fecha)*3.8052e-10)"/>
              <parameter key="Vector de pago" value="if([Diferencia mes] == 0 ||[Diferencia mes] ==1,0,&#10;if([Diferencia mes] == 2,1, &#10;if([Diferencia mes] ==3,2,&#10;if([Diferencia mes] ==4,3,&#10;if([Diferencia mes] ==5,4,&#10;if([Diferencia mes] ==6,5,&#10;if([Diferencia mes] &gt;= [7],6,0)))))))"/>
            </list>
            <parameter key="keep_all" value="true"/>
          </operator>
          <operator activated="true" class="select_attributes" compatibility="9.3.001" expanded="true" height="82" name="Select Attributes (2)" width="90" x="447" y="34">
            <parameter key="attribute_filter_type" value="subset"/>
            <parameter key="attribute" value=""/>
            <parameter key="attributes" value="Producto Generico|Tercerizado|Vector de Mora Real|Vector de Mora Reducido|asdd"/>
            <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"/>
          </operator>
          <connect from_op="Retrieve 1.BASE REAL ENRIQUECIDA UNIDA" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
          <connect from_op="Generate Attributes" from_port="example set output" to_op="Generate Attributes (4)" to_port="example set input"/>
          <connect from_op="Generate Attributes (4)" from_port="example set output" to_op="Select Attributes (2)" to_port="example set input"/>
          <connect from_op="Select Attributes (2)" from_port="example set output" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>
        </process>
      </operator>
    </process>

  • cdapontecdaponte Member Posts: 29 Maven
    Hi @tftemme i have already try putting Producto generico in brackets but it does not work...


  • cdapontecdaponte Member Posts: 29 Maven
    i was writting worng producto generico!!  :D Thanks!!!
  • varunm1varunm1 Member Posts: 1,207 Unicorn
    Thanks for sharing the process, can you share sample dataset? I see that you asked the same question earlier and we replied with similar answers. If you could provide a sample dataset we can debug.

    You can also set break point on the second generate attributes by right clicking on the operator and click on "breakpoint before". Run the process and see if all the attributes you are using in the generate attribute are present in the example set.
    Regards,
    Varun
    https://www.varunmandalapu.com/

    Be Safe. Follow precautions and Maintain Social Distancing

Sign In or Register to comment.