<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Expression depending on a condition in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Expression-depending-on-a-condition/m-p/2352347#M118760</link>
    <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;You don't get expected result or the expression does not work? To debugging the result, I would suggest to add new columns in the output table like condition1, condition2, condition3, condition4, maximun_2  and calculate the values of these columns, finally,  simplify the expression of price1 column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jul 2021 03:34:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-05T03:34:02Z</dc:date>
    <item>
      <title>Expression depending on a condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Expression-depending-on-a-condition/m-p/2352346#M118759</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I´ve developed a job in which I calculate price1 depending on 4 conditions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF those 4 conditions are "N", "Y", "Y", "Y" THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000GfUTUAA3.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143936iB3AA817F2E34D71D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000GfUTUAA3.jpg" alt="0695b00000GfUTUAA3.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF those conditions are other different than "N", "Y", "Y", "Y" THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000GfdJhAAJ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131474i1628EA5B1A35F1AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000GfdJhAAJ.jpg" alt="0695b00000GfdJhAAJ.jpg" /&gt;&lt;/span&gt;Depending on those 4 conditions, Price1 will be calculated with maximun_1 or with maximun_2.&lt;/P&gt;&lt;P&gt;I´ve wrote in the tmap the expression for the price_1 using maximun_1 or maximun_2 but it doesn´t work.&lt;/P&gt;&lt;P&gt;Does anybody can help me, please?&lt;/P&gt;&lt;P&gt;Thank you so much!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;U&gt;Conditions: &lt;/U&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt; condition_1: &lt;/B&gt; row4.prefijo == null?"N":"Y"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt; condition_2: &lt;/B&gt; row5.pais == null?"N":"Y"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt; condition_3: &lt;/B&gt; row6.precio_referencia_ge == null?"N":(row3.referencia == null||row3.referencia == 0)?"N":((row3.referencia-row6.precio_referencia_ge)*100)/(row3.referencia)&amp;gt;20?"Y":"N"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt; condition_4:&lt;/B&gt; row7.counter == null?"N" : row7.counter&amp;gt;2?"Y":"N"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;U&gt;Expression for "maximun_2"&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;(row4.prefijo == null)&amp;amp;&amp;amp;((row6.precio_referencia_geco == null?"N":(row3.referencia == null||row3.referencia == 0)?"N":&lt;/P&gt;&lt;P&gt;((row3.referencia-row6.precio_referencia_geco)*100)/(row3.referencia)&amp;gt;20?"Y":"N").equalsIgnoreCase("Y"))&amp;amp;&amp;amp;((row7.counter == null?"N" : row7.counter&amp;gt;2?"Y":"N").equalsIgnoreCase("Y"))&amp;amp;&amp;amp;(row5.pais != null)?row3.second_maximo:row3.maximo&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;U&gt;Expression for price1 is:&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;((((row12.minimo==null?0:row12.minimo )*1.6)-(row12.maximo==null?0:row12.maximo ))&amp;gt;=0)?(row12.minimo==null?0:row12.minimo ):((row12.maximo==null?0:row12.maximo)/1.6)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000GfdDtAAJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152876i03CA70F248DC850F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000GfdDtAAJ.png" alt="0695b00000GfdDtAAJ.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:59:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Expression-depending-on-a-condition/m-p/2352346#M118759</guid>
      <dc:creator>FGuijarro</dc:creator>
      <dc:date>2024-11-15T23:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Expression depending on a condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Expression-depending-on-a-condition/m-p/2352347#M118760</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;You don't get expected result or the expression does not work? To debugging the result, I would suggest to add new columns in the output table like condition1, condition2, condition3, condition4, maximun_2  and calculate the values of these columns, finally,  simplify the expression of price1 column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 03:34:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Expression-depending-on-a-condition/m-p/2352347#M118760</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-05T03:34:02Z</dc:date>
    </item>
  </channel>
</rss>

