<?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 New datas based on existing in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/New-datas-based-on-existing/m-p/150012#M28114</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI.&lt;/P&gt;&lt;P&gt;I'm newbie in Click.&lt;/P&gt;&lt;P&gt;I've got problem with creating new data based on existing.&lt;/P&gt;&lt;P&gt;I've got MS Excel file with just two columns.&lt;/P&gt;&lt;P&gt;KUNDE Segment code&lt;BR /&gt;133422 01000000000&lt;BR /&gt;163103 00000000000&lt;BR /&gt;133472 00000010010&lt;BR /&gt;160480 00000000000&lt;BR /&gt;170832 00000000000&lt;BR /&gt;162140 00000000000&lt;/P&gt;&lt;P&gt;This is file that asign Segmentation to Clients number. Segment code is code 01. Firstly i have to asign segment code to segment. This depend on position of 1 in code. Next i have to asign segment to upper segment. This is example script. I tried to do this for many way but it doesn't work. Please help me. Sorry for my English:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Left join (Sales)&lt;BR /&gt;LOAD KUNDE as [Client number],&lt;BR /&gt; [Segment code],&lt;BR /&gt; if(left([Segment code],1)=1,'Mass client',(if(mid([Segment code],2,1)=1,'Good product',&lt;BR /&gt; (if(mid([Segment code],3,1)=1,'Top shelf',&lt;BR /&gt; (if(mid([Segment code],7,1)=1,'Small',(if(mid([Segment code],8,1)=1,'Medium',&lt;BR /&gt; (if(mid([Segment code],9,1)=1,'Big',&lt;BR /&gt; (if(mid([Segment code],10,1)=1,'Basic',(if(mid([Segment code],11,1)=1,'Luxury',&lt;BR /&gt; (if(mid([Segment code],4,1)=1,'Key accounts',(if(mid([Segment code],5,1)=1,'Specialists',&lt;BR /&gt; (if(mid([Segment code],6,1)=1,'Small Fire','None'))))))))))))))))))))) as Segment,&lt;BR /&gt;&lt;BR /&gt;FROM [Additional data\Segmentacja.xls] (biff, embedded labels, table is Segmentacja$);&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Left join (Sales)&lt;BR /&gt;LOAD&lt;BR /&gt; [Client number],&lt;BR /&gt; [Segment code],&lt;BR /&gt; [Segment],&lt;BR /&gt;&lt;BR /&gt; if (Segment='Mass client' or Segment='Good product' or Segment='Top shelf', Windows&lt;BR /&gt; (if (Segment='Big' or Segment='Medium' or Segment='Small', Facade&lt;BR /&gt; (if(Segment='Luxury' or Segment='Basic', Interiors&lt;BR /&gt; (if(Segment='Key accounts' or Segment='Specialits' or Segment='Small Fire',Fire, None))))))) as [Upper Segment]&lt;BR /&gt;FROM Segmentacja$ (biff, embedded labels, table is Segmentacja1$);;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jul 2009 20:35:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-22T20:35:55Z</dc:date>
    <item>
      <title>New datas based on existing</title>
      <link>https://community.qlik.com/t5/QlikView/New-datas-based-on-existing/m-p/150012#M28114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI.&lt;/P&gt;&lt;P&gt;I'm newbie in Click.&lt;/P&gt;&lt;P&gt;I've got problem with creating new data based on existing.&lt;/P&gt;&lt;P&gt;I've got MS Excel file with just two columns.&lt;/P&gt;&lt;P&gt;KUNDE Segment code&lt;BR /&gt;133422 01000000000&lt;BR /&gt;163103 00000000000&lt;BR /&gt;133472 00000010010&lt;BR /&gt;160480 00000000000&lt;BR /&gt;170832 00000000000&lt;BR /&gt;162140 00000000000&lt;/P&gt;&lt;P&gt;This is file that asign Segmentation to Clients number. Segment code is code 01. Firstly i have to asign segment code to segment. This depend on position of 1 in code. Next i have to asign segment to upper segment. This is example script. I tried to do this for many way but it doesn't work. Please help me. Sorry for my English:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Left join (Sales)&lt;BR /&gt;LOAD KUNDE as [Client number],&lt;BR /&gt; [Segment code],&lt;BR /&gt; if(left([Segment code],1)=1,'Mass client',(if(mid([Segment code],2,1)=1,'Good product',&lt;BR /&gt; (if(mid([Segment code],3,1)=1,'Top shelf',&lt;BR /&gt; (if(mid([Segment code],7,1)=1,'Small',(if(mid([Segment code],8,1)=1,'Medium',&lt;BR /&gt; (if(mid([Segment code],9,1)=1,'Big',&lt;BR /&gt; (if(mid([Segment code],10,1)=1,'Basic',(if(mid([Segment code],11,1)=1,'Luxury',&lt;BR /&gt; (if(mid([Segment code],4,1)=1,'Key accounts',(if(mid([Segment code],5,1)=1,'Specialists',&lt;BR /&gt; (if(mid([Segment code],6,1)=1,'Small Fire','None'))))))))))))))))))))) as Segment,&lt;BR /&gt;&lt;BR /&gt;FROM [Additional data\Segmentacja.xls] (biff, embedded labels, table is Segmentacja$);&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Left join (Sales)&lt;BR /&gt;LOAD&lt;BR /&gt; [Client number],&lt;BR /&gt; [Segment code],&lt;BR /&gt; [Segment],&lt;BR /&gt;&lt;BR /&gt; if (Segment='Mass client' or Segment='Good product' or Segment='Top shelf', Windows&lt;BR /&gt; (if (Segment='Big' or Segment='Medium' or Segment='Small', Facade&lt;BR /&gt; (if(Segment='Luxury' or Segment='Basic', Interiors&lt;BR /&gt; (if(Segment='Key accounts' or Segment='Specialits' or Segment='Small Fire',Fire, None))))))) as [Upper Segment]&lt;BR /&gt;FROM Segmentacja$ (biff, embedded labels, table is Segmentacja1$);;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2009 20:35:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-datas-based-on-existing/m-p/150012#M28114</guid>
      <dc:creator />
      <dc:date>2009-07-22T20:35:55Z</dc:date>
    </item>
    <item>
      <title>New datas based on existing</title>
      <link>https://community.qlik.com/t5/QlikView/New-datas-based-on-existing/m-p/150013#M28115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;pick(index("Segment code",'1')+1,'Other','Good product','Top shelf',...) as "Segment"&lt;BR /&gt;,pick(index("Segment code",'1')+1,'None' ,'Windows' ,'Windows' ,...) as "Upper Segment"&lt;/P&gt;&lt;P&gt;It might be too simplistic, as you aren't checking the positions in order like this will, but I don't know if that's important. If it is, rearranging the codes to the order you want might be simpler than a series of IF() statements.&lt;/P&gt;&lt;P&gt;As for the posted script, I'm not sure what the "Next" is doing there since you don't otherwise show a loop, you have two semicolons after the last statement, you need to put literals like 'Windows' in single quotes in the second load, and there may be other problems because I didn't look closely.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 02:06:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-datas-based-on-existing/m-p/150013#M28115</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-07-23T02:06:29Z</dc:date>
    </item>
  </channel>
</rss>

