<?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 Insert value based on condition in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Insert-value-based-on-condition/m-p/1598671#M44255</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I would like to add a new field name in an existing table and load the data using if condition in the SQL statement.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;[c1],&lt;BR /&gt;[c2],&lt;BR /&gt;[c3],[c4],[c5],&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SQL SELECT `c1`,&lt;BR /&gt;`c2`,&lt;BR /&gt;`c3`,&lt;/P&gt;&lt;P&gt;`c4`,&lt;/P&gt;&lt;P&gt;`c5`,&lt;/P&gt;&lt;P&gt;Here c5 is the new column which I am trying to create in the load script and then I want to use some kind of condition in the SQL statement to insert the value into c5 which is newly created.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;c5&lt;/TD&gt;&lt;TD&gt;Products&lt;/TD&gt;&lt;TD&gt;Sticky&lt;/TD&gt;&lt;TD&gt;Digi&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AA&lt;/TD&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;A3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BB&lt;/TD&gt;&lt;TD&gt;B1&lt;/TD&gt;&lt;TD&gt;B2&lt;/TD&gt;&lt;TD&gt;B3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CC&lt;/TD&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;C3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so here the condition would be if Products=A1 &amp;amp; Sticky=A2 &amp;amp; Digi=A3 then we need to insert 'AA' into a newly created column which is c5 and similar logic to all the others. Also, I would like to use OR condition between AA , BB and CC so on .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:31:45 GMT</pubDate>
    <dc:creator>tejes</dc:creator>
    <dc:date>2024-11-16T20:31:45Z</dc:date>
    <item>
      <title>Insert value based on condition</title>
      <link>https://community.qlik.com/t5/App-Development/Insert-value-based-on-condition/m-p/1598671#M44255</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I would like to add a new field name in an existing table and load the data using if condition in the SQL statement.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;[c1],&lt;BR /&gt;[c2],&lt;BR /&gt;[c3],[c4],[c5],&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SQL SELECT `c1`,&lt;BR /&gt;`c2`,&lt;BR /&gt;`c3`,&lt;/P&gt;&lt;P&gt;`c4`,&lt;/P&gt;&lt;P&gt;`c5`,&lt;/P&gt;&lt;P&gt;Here c5 is the new column which I am trying to create in the load script and then I want to use some kind of condition in the SQL statement to insert the value into c5 which is newly created.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;c5&lt;/TD&gt;&lt;TD&gt;Products&lt;/TD&gt;&lt;TD&gt;Sticky&lt;/TD&gt;&lt;TD&gt;Digi&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AA&lt;/TD&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;A3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BB&lt;/TD&gt;&lt;TD&gt;B1&lt;/TD&gt;&lt;TD&gt;B2&lt;/TD&gt;&lt;TD&gt;B3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CC&lt;/TD&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;C3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so here the condition would be if Products=A1 &amp;amp; Sticky=A2 &amp;amp; Digi=A3 then we need to insert 'AA' into a newly created column which is c5 and similar logic to all the others. Also, I would like to use OR condition between AA , BB and CC so on .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:31:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Insert-value-based-on-condition/m-p/1598671#M44255</guid>
      <dc:creator>tejes</dc:creator>
      <dc:date>2024-11-16T20:31:45Z</dc:date>
    </item>
  </channel>
</rss>

