<?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 Use of a reference number to separate 2 distinct categories in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Use-of-a-reference-number-to-separate-2-distinct-categories/m-p/1805536#M65496</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I need your help to separate 2 distinct categories (old units from new units) having a reference serial number in a consecutive series (please find attached a simple example). What formula should I use to get separate the 2 categories?&lt;/P&gt;&lt;P&gt;What I want to count is the Old units and the New Units, having the serial number as separator between the 2 categories.&lt;/P&gt;&lt;P&gt;If(Serial number&amp;lt;V12, 'old units')&lt;/P&gt;&lt;P&gt;If(Serial number&amp;gt;=V12, , 'new units')&lt;/P&gt;&lt;P&gt;But the things become complicated because the serial number format contains a letter followed by figures.&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Dec 2021 21:56:36 GMT</pubDate>
    <dc:creator>mvtriff</dc:creator>
    <dc:date>2021-12-21T21:56:36Z</dc:date>
    <item>
      <title>Use of a reference number to separate 2 distinct categories</title>
      <link>https://community.qlik.com/t5/App-Development/Use-of-a-reference-number-to-separate-2-distinct-categories/m-p/1805536#M65496</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I need your help to separate 2 distinct categories (old units from new units) having a reference serial number in a consecutive series (please find attached a simple example). What formula should I use to get separate the 2 categories?&lt;/P&gt;&lt;P&gt;What I want to count is the Old units and the New Units, having the serial number as separator between the 2 categories.&lt;/P&gt;&lt;P&gt;If(Serial number&amp;lt;V12, 'old units')&lt;/P&gt;&lt;P&gt;If(Serial number&amp;gt;=V12, , 'new units')&lt;/P&gt;&lt;P&gt;But the things become complicated because the serial number format contains a letter followed by figures.&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 21:56:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-of-a-reference-number-to-separate-2-distinct-categories/m-p/1805536#M65496</guid>
      <dc:creator>mvtriff</dc:creator>
      <dc:date>2021-12-21T21:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use of a reference number to separate 2 distinct categories</title>
      <link>https://community.qlik.com/t5/App-Development/Use-of-a-reference-number-to-separate-2-distinct-categories/m-p/1806641#M65615</link>
      <description>&lt;P&gt;One way to accomplish it would be simply creating a Unit Type table that could be associated with the data:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Versions:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Version, UnitType&lt;BR /&gt;V1, Old&lt;BR /&gt;V6, Old&lt;BR /&gt;V7, Old&lt;BR /&gt;V12, Old&lt;BR /&gt;V13, New&lt;BR /&gt;V14, New&lt;BR /&gt;V17, New&lt;BR /&gt;V19, New&lt;BR /&gt;V22, New&lt;BR /&gt;V33, New&lt;BR /&gt;];&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;// Load the data&lt;BR /&gt;StockData:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Price, Text, MaterialNumber, Version&lt;BR /&gt;10000, t-shirt, 93849, V6&lt;BR /&gt;20000, pants, 93002, V13&lt;BR /&gt;10000, t-shirt, 88493, V22&lt;BR /&gt;30200, pants, 98390, V17&lt;BR /&gt;20000, pants, 18837, V7&lt;BR /&gt;23000, shirts, 93982, V12&lt;BR /&gt;22000, skirts, 39820, V19&lt;BR /&gt;22010, skirts, 3921983, V33&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Second way would be to create a MAP and then do an APPLY MAP to handle the cross reference:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;VersionsMap:&lt;BR /&gt;Mapping Load * Inline [&lt;BR /&gt;Version, UnitType&lt;BR /&gt;V1, Old&lt;BR /&gt;V6, Old&lt;BR /&gt;V7, Old&lt;BR /&gt;V12, Old&lt;BR /&gt;V13, New&lt;BR /&gt;V14, New&lt;BR /&gt;V17, New&lt;BR /&gt;V19, New&lt;BR /&gt;V22, New&lt;BR /&gt;V33, New&lt;BR /&gt;];&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;// Load the data&lt;BR /&gt;StockData:&lt;BR /&gt;Load Price, Text, MaterialNumber, Version, ApplyMap('VersionsMap', Version) as UnitType;&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Price, Text, MaterialNumber, Version&lt;BR /&gt;10000, t-shirt, 93849, V6&lt;BR /&gt;20000, pants, 93002, V13&lt;BR /&gt;10000, t-shirt, 88493, V22&lt;BR /&gt;30200, pants, 98390, V17&lt;BR /&gt;20000, pants, 18837, V7&lt;BR /&gt;23000, shirts, 93982, V12&lt;BR /&gt;22000, skirts, 39820, V19&lt;BR /&gt;22010, skirts, 3921983, V33&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Or you can simply use the REPLACE function to remove the V and just keep the numerics:&lt;/P&gt;&lt;P&gt;// Load the data&lt;BR /&gt;StockData:&lt;BR /&gt;Load Price, Text, MaterialNumber, Version, &lt;STRONG&gt;If(Replace(Version, 'V','') &amp;gt; 11, 'New', 'Old')&lt;/STRONG&gt; as UnitType;&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Price, Text, MaterialNumber, Version&lt;BR /&gt;10000, t-shirt, 93849, V6&lt;BR /&gt;20000, pants, 93002, V13&lt;BR /&gt;10000, t-shirt, 88493, V22&lt;BR /&gt;30200, pants, 98390, V17&lt;BR /&gt;20000, pants, 18837, V7&lt;BR /&gt;23000, shirts, 93982, V12&lt;BR /&gt;22000, skirts, 39820, V19&lt;BR /&gt;22010, skirts, 3921983, V33&lt;BR /&gt;];&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 14:00:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-of-a-reference-number-to-separate-2-distinct-categories/m-p/1806641#M65615</guid>
      <dc:creator>Dalton_Ruer</dc:creator>
      <dc:date>2021-05-10T14:00:11Z</dc:date>
    </item>
  </channel>
</rss>

