<?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 Create a Column with Ifs (better options?) in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93345#M6223</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating with help of a good colleague a dashboard for a Survey of more than 250 respondents. It's an easy Excel but we are facing an issue. We have applied Crosstables so the table (TABLE_TEMP) right now is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Respondent ID&lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;Team&lt;/P&gt;&lt;P&gt;Manager&lt;/P&gt;&lt;P&gt;Region&lt;/P&gt;&lt;P&gt;Questions&lt;/P&gt;&lt;P&gt;Results&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to create a new column that would group the questions depending on their nature. We have created a new table that is called TABLE_DETAIL that includes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Respondent ID&lt;/P&gt;&lt;P&gt;Question Group&lt;/P&gt;&lt;P&gt;Question Detail&lt;/P&gt;&lt;P&gt;Response Value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code we have applied is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLE_DETAIL:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Respondent ID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Questions = 'Question Value 1', 'First Grouping',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Questions = 'Question Value 2', 'First Grouping',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Questions = 'Question Value 3', Second Grouping'))) as "Question Group"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Questions as "Question Detail"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Results as "Response Value"&lt;/P&gt;&lt;P&gt;Resident TABLE_DETAIL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 17 different types of questions resulting in 5 question groups, which means we would have to add 13 more IFs to our code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any better way to do this? Either concatenating, or iterating on the first table and with no need of creating a new one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2018 14:55:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-08-16T14:55:33Z</dc:date>
    <item>
      <title>Create a Column with Ifs (better options?)</title>
      <link>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93345#M6223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating with help of a good colleague a dashboard for a Survey of more than 250 respondents. It's an easy Excel but we are facing an issue. We have applied Crosstables so the table (TABLE_TEMP) right now is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Respondent ID&lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;Team&lt;/P&gt;&lt;P&gt;Manager&lt;/P&gt;&lt;P&gt;Region&lt;/P&gt;&lt;P&gt;Questions&lt;/P&gt;&lt;P&gt;Results&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to create a new column that would group the questions depending on their nature. We have created a new table that is called TABLE_DETAIL that includes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Respondent ID&lt;/P&gt;&lt;P&gt;Question Group&lt;/P&gt;&lt;P&gt;Question Detail&lt;/P&gt;&lt;P&gt;Response Value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code we have applied is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLE_DETAIL:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Respondent ID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Questions = 'Question Value 1', 'First Grouping',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Questions = 'Question Value 2', 'First Grouping',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Questions = 'Question Value 3', Second Grouping'))) as "Question Group"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Questions as "Question Detail"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Results as "Response Value"&lt;/P&gt;&lt;P&gt;Resident TABLE_DETAIL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 17 different types of questions resulting in 5 question groups, which means we would have to add 13 more IFs to our code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any better way to do this? Either concatenating, or iterating on the first table and with no need of creating a new one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:55:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93345#M6223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-16T14:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Column with Ifs (better options?)</title>
      <link>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93346#M6224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create an Inline table or read a table from excel with two columns (whichever is easier for you to maintain).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question, Group&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question Value 1, First Grouping&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question Value 2, First Grouping&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question Value 3, Second Grouping&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join this to the original table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 15:10:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93346#M6224</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2018-08-16T15:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Column with Ifs (better options?)</title>
      <link>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93347#M6225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To expand upon Vamsee's asnwer, if you were to go with his suggestion and use the link table then the 'question' values within his inline table would need to match those in your original data table exactly.&amp;nbsp; In essence, the inline table is being used as a reference table which will sit alongside the original data table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something else that Vamsee alighted to in his response was the joining of the two tables.&amp;nbsp; Don't get me wrong it will work if you were to keep the two data table seperate as long as those were joined on a single common field name.&amp;nbsp; However, what may be neater, would be to join the two table so that all of the data is held within the one table.&amp;nbsp; This could be done by using the following script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LEFT JOIN (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;TABLE_DETAIL&lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD * INLINE [&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Questions, Group&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question1, First Grouping&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question2, First Grouping&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question3, Second Grouping&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;];&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this is what you were looking for.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let me know how you get on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 15:39:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93347#M6225</guid>
      <dc:creator>michaelsmith</dc:creator>
      <dc:date>2018-08-16T15:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Column with Ifs (better options?)</title>
      <link>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93348#M6226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right Michael about keeping two tables separate would improve the performance and reduce the possibilities of duplicate records.&lt;/P&gt;&lt;P&gt;Also, on the same note if the requirement is to have the new column in the same table I would also suggest a mapping load.&lt;/P&gt;&lt;P&gt;Group_Map:&lt;/P&gt;&lt;P&gt;Mapping Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Questions,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD * INLINE [&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Questions, Group&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question1, First Grouping&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question2, First Grouping&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question3, Second Grouping&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;]; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;and then Applymap('Group_Map',&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Questions, 'Default Group') as [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Question Group]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 17:12:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-a-Column-with-Ifs-better-options/m-p/93348#M6226</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2018-08-16T17:12:28Z</dc:date>
    </item>
  </channel>
</rss>

