<?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 Brainstorming, help creating a new dataset in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Brainstorming-help-creating-a-new-dataset/m-p/1828922#M68319</link>
    <description>&lt;P&gt;Not sure how to approach this problem.&lt;/P&gt;&lt;P&gt;I have a table with two columns, "name" and "case no".&lt;BR /&gt;A case no can have 1 or more people belonging to it (actually in some cases it can be an empty case no, but I don't think that makes a difference here).&lt;/P&gt;&lt;P&gt;From the above table I would like to create a new dataset with 3 columns, "source", "target" and "nooftimes". This table should contain all the names, and show who and how many times certain names have been together in the same cases.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;name, case no&lt;/P&gt;&lt;P&gt;Dan, AB546&lt;/P&gt;&lt;P&gt;Sue, TY874&lt;/P&gt;&lt;P&gt;Steve, AB546&lt;/P&gt;&lt;P&gt;Brian, UI983&lt;/P&gt;&lt;P&gt;Glen, TT132&lt;/P&gt;&lt;P&gt;Jane, TY874&lt;/P&gt;&lt;P&gt;Sue, TT132&lt;/P&gt;&lt;P&gt;Jane, TT132&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is what I want to achieve. A dataset with the connections...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;source, target, nooftimes&lt;/P&gt;&lt;P&gt;Dan, Steve, 1&lt;/P&gt;&lt;P&gt;Steve, Dan, 1&lt;/P&gt;&lt;P&gt;Sue, Jane, 2&lt;/P&gt;&lt;P&gt;Jane, Sue, 2&lt;/P&gt;&lt;P&gt;Glen, Jane, 1&lt;/P&gt;&lt;P&gt;Jane, Glen, 1&lt;/P&gt;&lt;P&gt;Glen, Sue, 1&lt;/P&gt;&lt;P&gt;Sue, Glen, 1&lt;/P&gt;&lt;P&gt;Brian, -, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can this be achieved?&lt;BR /&gt;Any help is apreciated&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 16:25:32 GMT</pubDate>
    <dc:creator>John5</dc:creator>
    <dc:date>2021-11-30T16:25:32Z</dc:date>
    <item>
      <title>Brainstorming, help creating a new dataset</title>
      <link>https://community.qlik.com/t5/App-Development/Brainstorming-help-creating-a-new-dataset/m-p/1828922#M68319</link>
      <description>&lt;P&gt;Not sure how to approach this problem.&lt;/P&gt;&lt;P&gt;I have a table with two columns, "name" and "case no".&lt;BR /&gt;A case no can have 1 or more people belonging to it (actually in some cases it can be an empty case no, but I don't think that makes a difference here).&lt;/P&gt;&lt;P&gt;From the above table I would like to create a new dataset with 3 columns, "source", "target" and "nooftimes". This table should contain all the names, and show who and how many times certain names have been together in the same cases.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;name, case no&lt;/P&gt;&lt;P&gt;Dan, AB546&lt;/P&gt;&lt;P&gt;Sue, TY874&lt;/P&gt;&lt;P&gt;Steve, AB546&lt;/P&gt;&lt;P&gt;Brian, UI983&lt;/P&gt;&lt;P&gt;Glen, TT132&lt;/P&gt;&lt;P&gt;Jane, TY874&lt;/P&gt;&lt;P&gt;Sue, TT132&lt;/P&gt;&lt;P&gt;Jane, TT132&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is what I want to achieve. A dataset with the connections...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;source, target, nooftimes&lt;/P&gt;&lt;P&gt;Dan, Steve, 1&lt;/P&gt;&lt;P&gt;Steve, Dan, 1&lt;/P&gt;&lt;P&gt;Sue, Jane, 2&lt;/P&gt;&lt;P&gt;Jane, Sue, 2&lt;/P&gt;&lt;P&gt;Glen, Jane, 1&lt;/P&gt;&lt;P&gt;Jane, Glen, 1&lt;/P&gt;&lt;P&gt;Glen, Sue, 1&lt;/P&gt;&lt;P&gt;Sue, Glen, 1&lt;/P&gt;&lt;P&gt;Brian, -, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can this be achieved?&lt;BR /&gt;Any help is apreciated&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 16:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Brainstorming-help-creating-a-new-dataset/m-p/1828922#M68319</guid>
      <dc:creator>John5</dc:creator>
      <dc:date>2021-11-30T16:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Brainstorming, help creating a new dataset</title>
      <link>https://community.qlik.com/t5/App-Development/Brainstorming-help-creating-a-new-dataset/m-p/1828930#M68321</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/147690"&gt;@John5&lt;/a&gt;&amp;nbsp; one way&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;data:
LOAD * Inline [
name, case no
Dan, AB546
Sue, TY874
Steve, AB546
Brian, UI983
Glen, TT132
Jane, TY874
Sue, TT132
Jane, TT132 ];

Left Join(data)
Load [case no],
     concat(name,'|') as Names_by_case
Resident data
Group by [case no]; 

Join(data)
Load FieldValue('name',RecNo()) as All_Names
AutoGenerate FieldValueCount('name');

T1: 
Load *,
     if(All_Names&amp;lt;&amp;gt;name and SubStringCount(Names_by_case,'|'),
    if(SubStringCount(Names_by_case,name) and SubStringCount(Names_by_case,All_Names),name),
    if(not SubStringCount(Names_by_case,'|') and Names_by_case=All_Names,name)) as Source,
    
    if(All_Names&amp;lt;&amp;gt;name and SubStringCount(Names_by_case,'|'),
    if(SubStringCount(Names_by_case,name) and SubStringCount(Names_by_case,All_Names),All_Names),
    if(not SubStringCount(Names_by_case,'|') and Names_by_case=All_Names,Null())) as Target,
    
    if(All_Names&amp;lt;&amp;gt;name and SubStringCount(Names_by_case,'|'),
    if(SubStringCount(Names_by_case,name) and SubStringCount(Names_by_case,All_Names),1),
    if(not SubStringCount(Names_by_case,'|') and Names_by_case=All_Names,1)) as Flag,
    
    if(not SubStringCount(Names_by_case,'|') and Names_by_case=All_Names,1) as Flag_0_time

Resident data;

Drop Table data;

Final:
Load Source,
     Target,
     Sum(if(Flag_0_time=1,0,Flag)) as no_of_times
Resident T1
where Flag=1
Group by Source,Target;

Drop Table T1;&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kushal_Chawda_0-1629157393899.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60169iF264C83040B2F2E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kushal_Chawda_0-1629157393899.png" alt="Kushal_Chawda_0-1629157393899.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 23:43:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Brainstorming-help-creating-a-new-dataset/m-p/1828930#M68321</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2021-08-16T23:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Brainstorming, help creating a new dataset</title>
      <link>https://community.qlik.com/t5/App-Development/Brainstorming-help-creating-a-new-dataset/m-p/1828983#M68326</link>
      <description>&lt;P&gt;Thank you so much.&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This was exactly the result I wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking at your script, I don't think I would have figured this out myself.&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 08:30:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Brainstorming-help-creating-a-new-dataset/m-p/1828983#M68326</guid>
      <dc:creator>John5</dc:creator>
      <dc:date>2021-08-17T08:30:35Z</dc:date>
    </item>
  </channel>
</rss>

