<?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 Challenging problem, merging two resident tables. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Challenging-problem-merging-two-resident-tables/m-p/183955#M49020</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys, I really got stuck with this stuff, and I want to know if it's possible to merge two resident tables to get the following result :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an inline data which shows lines of scheme accounts.&lt;/P&gt;&lt;P&gt;I need to separate the accounts of type 'F'. --&amp;gt; I've done it&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;And after that I need to split the separators '/' and '+'. --&amp;gt; I've done it.&lt;/P&gt;&lt;P&gt;I got stuck with this table (which shows ranks of numbers) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-2269_sourceID:2269" /&gt;&lt;/P&gt;&lt;P&gt;I need to show the numbers from the minimum rank number to the last rank number.&lt;/P&gt;&lt;P&gt;I need to pick the "N_Fila" values from the "OriginTable" because in there I have all the possible values, and compare it with the "min" value and the "max" value of my table.&lt;/P&gt;&lt;P&gt;For example : I now that inside the rank "20..60" there is 20,30,40,50,60 because these numbers are in the original list.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I was thinking about some king of crossing two resident tables, but I'm completely lost.&lt;BR /&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;My desired result would be :&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;N_Fila Sumatorio&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 20&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 30&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 40&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 50&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 60&lt;/P&gt;&lt;P style="font-weight: bold"&gt;80 10&lt;/P&gt;&lt;P style="font-weight: bold"&gt;80 70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Now I give you my code, to make it easier :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OrigenDades :&lt;BR /&gt;&lt;BR /&gt;load *&lt;BR /&gt;inline [&lt;BR /&gt;&lt;BR /&gt;N_Fila ,Descripcion,Tipo_Sumatorio,Sumatorio&lt;BR /&gt;&lt;BR /&gt;10,FACTURACION BRUTA,Cuentas mayor,7000011..7010003|7050001..7050003|7050005..7056004|7080001..7080003|6030001..6030004|7030001..7030004|7320001&lt;BR /&gt;20,Comisiones Externas,Cuentas mayor,6230000..6230010&lt;BR /&gt;30,Montajes ,Cuentas mayor,6070002..6070005&lt;BR /&gt;40,Transportes Asignables,Cuentas mayor,6240001..6240002|6240004..6240011|6240020..6240021|7056005|6240015&lt;BR /&gt;50,Transportes Muestras,Cuentas mayor,6240013|6240023|6240018|6240019&lt;BR /&gt;60,Transportes NO Asignables,Cuentas mayor,6240000|6240500|6240014|6240016|6240017&lt;BR /&gt;70,TOTAL GASTOS VARIABLES,F,20..60&lt;BR /&gt;80,FACTURACION NETA,F,10|70&lt;BR /&gt;90,TOTAL CONSUMO MATERIA PRIMA,Cuentas mayor,6000001..6010004|6110001..6110001|7020001..7020004|7120000..7120001|6091001&lt;BR /&gt;100,MARGEN EXPLOTACIÓN,F,80+90&lt;BR /&gt;110,Sueldos y Salarios,Cuentas mayor,6400001..6400007|7550001..7550001|6230211|6290701&lt;BR /&gt;120,Incentivos Salariales,Cuentas mayor,6400008..6400100&lt;BR /&gt;130,Retribuciones Especie,Cuentas mayor ,6210009|6210012|6210013|6210015|6210017|6210019|6210021|6210023|6210024|6210025|6210026&lt;BR /&gt;140,Indemnizaciones Cuentas,Cuentas Auxiliar,6410001&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cuentas_Formula :&lt;BR /&gt;&lt;BR /&gt;load&lt;BR /&gt;&lt;BR /&gt; N_Fila as N_Fila,&lt;BR /&gt; Sumatorio as Sumatorio_Formula&lt;BR /&gt;resident OrigenDades where "Tipo_Sumatorio" like 'F';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cuentas_Formula2 :&lt;BR /&gt;&lt;BR /&gt;load&lt;BR /&gt;&lt;BR /&gt;N_Fila,&lt;BR /&gt;&lt;BR /&gt;if ( subfield(Sumatorio_Formula,'+') ,&lt;BR /&gt; subfield(Sumatorio_Formula,'+') ,&lt;BR /&gt;&lt;BR /&gt; if( subfield(Sumatorio_Formula,'|') ,&lt;BR /&gt;&lt;BR /&gt; subfield(Sumatorio_Formula,'|'),&lt;BR /&gt;&lt;BR /&gt; Sumatorio_Formula )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; ) as Sumatorio_Formula2&lt;BR /&gt;&lt;BR /&gt;resident Cuentas_Formula where "N_Fila"&amp;lt;&amp;gt;'540';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cuentas_Formula3 :&lt;BR /&gt;&lt;BR /&gt;load&lt;BR /&gt;&lt;BR /&gt;N_Fila,&lt;BR /&gt;&lt;BR /&gt;Sumatorio_Formula2 as Sumatorio_Formula3 ,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if( left(Sumatorio_Formula2,index(Sumatorio_Formula2,'..')-1), left(Sumatorio_Formula2,index(Sumatorio_Formula2,'..')-1) ,Sumatorio_Formula2 ) as min,&lt;BR /&gt;&lt;BR /&gt;if(right(Sumatorio_Formula2,index(Sumatorio_Formula2,'..')-1), right(Sumatorio_Formula2,index(Sumatorio_Formula2,'..')-1),Sumatorio_Formula2 ) as max&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;resident Cuentas_Formula2;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Temp_Counter_Formula :&lt;BR /&gt;&lt;BR /&gt;mapping load&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;N_Fila,&lt;BR /&gt;&lt;BR /&gt;count(N_Fila)as Fila_Counter&lt;BR /&gt;&lt;BR /&gt;resident Cuentas_Formula3 group by N_Fila;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;set nMaxFila = fieldValueCount('N_Fila');&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//for i=0 to $(nMaxFila)&lt;BR /&gt;//&lt;BR /&gt;//set nMaxFila2 = applymap('Temp_Counter_Formula',peek($(i))) ;&lt;BR /&gt;//&lt;BR /&gt;// for j=0 to $(nMaxFila2)&lt;BR /&gt;//&lt;BR /&gt;//// Temp_dades :&lt;BR /&gt;////&lt;BR /&gt;//// load&lt;BR /&gt;////&lt;BR /&gt;//// N_Fila,&lt;BR /&gt;////&lt;BR /&gt;//// // CONCAT(N_Fila, ',',Orden_N_Fila)&lt;BR /&gt;////&lt;BR /&gt;//// if ( N_Fila &amp;lt;= min,'a','b' ) AS IdOrigenDades&lt;BR /&gt;////&lt;BR /&gt;////&lt;BR /&gt;//// resident OrigenDades ;&lt;BR /&gt;//&lt;BR /&gt;// next&lt;BR /&gt;//&lt;BR /&gt;//next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Sep 2010 17:54:34 GMT</pubDate>
    <dc:creator>marcel_olmo</dc:creator>
    <dc:date>2010-09-01T17:54:34Z</dc:date>
    <item>
      <title>Challenging problem, merging two resident tables.</title>
      <link>https://community.qlik.com/t5/QlikView/Challenging-problem-merging-two-resident-tables/m-p/183955#M49020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys, I really got stuck with this stuff, and I want to know if it's possible to merge two resident tables to get the following result :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an inline data which shows lines of scheme accounts.&lt;/P&gt;&lt;P&gt;I need to separate the accounts of type 'F'. --&amp;gt; I've done it&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;And after that I need to split the separators '/' and '+'. --&amp;gt; I've done it.&lt;/P&gt;&lt;P&gt;I got stuck with this table (which shows ranks of numbers) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-2269_sourceID:2269" /&gt;&lt;/P&gt;&lt;P&gt;I need to show the numbers from the minimum rank number to the last rank number.&lt;/P&gt;&lt;P&gt;I need to pick the "N_Fila" values from the "OriginTable" because in there I have all the possible values, and compare it with the "min" value and the "max" value of my table.&lt;/P&gt;&lt;P&gt;For example : I now that inside the rank "20..60" there is 20,30,40,50,60 because these numbers are in the original list.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I was thinking about some king of crossing two resident tables, but I'm completely lost.&lt;BR /&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;My desired result would be :&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;N_Fila Sumatorio&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 20&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 30&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 40&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 50&lt;/P&gt;&lt;P style="font-weight: bold"&gt;70 60&lt;/P&gt;&lt;P style="font-weight: bold"&gt;80 10&lt;/P&gt;&lt;P style="font-weight: bold"&gt;80 70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Now I give you my code, to make it easier :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OrigenDades :&lt;BR /&gt;&lt;BR /&gt;load *&lt;BR /&gt;inline [&lt;BR /&gt;&lt;BR /&gt;N_Fila ,Descripcion,Tipo_Sumatorio,Sumatorio&lt;BR /&gt;&lt;BR /&gt;10,FACTURACION BRUTA,Cuentas mayor,7000011..7010003|7050001..7050003|7050005..7056004|7080001..7080003|6030001..6030004|7030001..7030004|7320001&lt;BR /&gt;20,Comisiones Externas,Cuentas mayor,6230000..6230010&lt;BR /&gt;30,Montajes ,Cuentas mayor,6070002..6070005&lt;BR /&gt;40,Transportes Asignables,Cuentas mayor,6240001..6240002|6240004..6240011|6240020..6240021|7056005|6240015&lt;BR /&gt;50,Transportes Muestras,Cuentas mayor,6240013|6240023|6240018|6240019&lt;BR /&gt;60,Transportes NO Asignables,Cuentas mayor,6240000|6240500|6240014|6240016|6240017&lt;BR /&gt;70,TOTAL GASTOS VARIABLES,F,20..60&lt;BR /&gt;80,FACTURACION NETA,F,10|70&lt;BR /&gt;90,TOTAL CONSUMO MATERIA PRIMA,Cuentas mayor,6000001..6010004|6110001..6110001|7020001..7020004|7120000..7120001|6091001&lt;BR /&gt;100,MARGEN EXPLOTACIÓN,F,80+90&lt;BR /&gt;110,Sueldos y Salarios,Cuentas mayor,6400001..6400007|7550001..7550001|6230211|6290701&lt;BR /&gt;120,Incentivos Salariales,Cuentas mayor,6400008..6400100&lt;BR /&gt;130,Retribuciones Especie,Cuentas mayor ,6210009|6210012|6210013|6210015|6210017|6210019|6210021|6210023|6210024|6210025|6210026&lt;BR /&gt;140,Indemnizaciones Cuentas,Cuentas Auxiliar,6410001&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cuentas_Formula :&lt;BR /&gt;&lt;BR /&gt;load&lt;BR /&gt;&lt;BR /&gt; N_Fila as N_Fila,&lt;BR /&gt; Sumatorio as Sumatorio_Formula&lt;BR /&gt;resident OrigenDades where "Tipo_Sumatorio" like 'F';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cuentas_Formula2 :&lt;BR /&gt;&lt;BR /&gt;load&lt;BR /&gt;&lt;BR /&gt;N_Fila,&lt;BR /&gt;&lt;BR /&gt;if ( subfield(Sumatorio_Formula,'+') ,&lt;BR /&gt; subfield(Sumatorio_Formula,'+') ,&lt;BR /&gt;&lt;BR /&gt; if( subfield(Sumatorio_Formula,'|') ,&lt;BR /&gt;&lt;BR /&gt; subfield(Sumatorio_Formula,'|'),&lt;BR /&gt;&lt;BR /&gt; Sumatorio_Formula )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; ) as Sumatorio_Formula2&lt;BR /&gt;&lt;BR /&gt;resident Cuentas_Formula where "N_Fila"&amp;lt;&amp;gt;'540';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cuentas_Formula3 :&lt;BR /&gt;&lt;BR /&gt;load&lt;BR /&gt;&lt;BR /&gt;N_Fila,&lt;BR /&gt;&lt;BR /&gt;Sumatorio_Formula2 as Sumatorio_Formula3 ,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if( left(Sumatorio_Formula2,index(Sumatorio_Formula2,'..')-1), left(Sumatorio_Formula2,index(Sumatorio_Formula2,'..')-1) ,Sumatorio_Formula2 ) as min,&lt;BR /&gt;&lt;BR /&gt;if(right(Sumatorio_Formula2,index(Sumatorio_Formula2,'..')-1), right(Sumatorio_Formula2,index(Sumatorio_Formula2,'..')-1),Sumatorio_Formula2 ) as max&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;resident Cuentas_Formula2;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Temp_Counter_Formula :&lt;BR /&gt;&lt;BR /&gt;mapping load&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;N_Fila,&lt;BR /&gt;&lt;BR /&gt;count(N_Fila)as Fila_Counter&lt;BR /&gt;&lt;BR /&gt;resident Cuentas_Formula3 group by N_Fila;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;set nMaxFila = fieldValueCount('N_Fila');&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//for i=0 to $(nMaxFila)&lt;BR /&gt;//&lt;BR /&gt;//set nMaxFila2 = applymap('Temp_Counter_Formula',peek($(i))) ;&lt;BR /&gt;//&lt;BR /&gt;// for j=0 to $(nMaxFila2)&lt;BR /&gt;//&lt;BR /&gt;//// Temp_dades :&lt;BR /&gt;////&lt;BR /&gt;//// load&lt;BR /&gt;////&lt;BR /&gt;//// N_Fila,&lt;BR /&gt;////&lt;BR /&gt;//// // CONCAT(N_Fila, ',',Orden_N_Fila)&lt;BR /&gt;////&lt;BR /&gt;//// if ( N_Fila &amp;lt;= min,'a','b' ) AS IdOrigenDades&lt;BR /&gt;////&lt;BR /&gt;////&lt;BR /&gt;//// resident OrigenDades ;&lt;BR /&gt;//&lt;BR /&gt;// next&lt;BR /&gt;//&lt;BR /&gt;//next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Sep 2010 17:54:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Challenging-problem-merging-two-resident-tables/m-p/183955#M49020</guid>
      <dc:creator>marcel_olmo</dc:creator>
      <dc:date>2010-09-01T17:54:34Z</dc:date>
    </item>
  </channel>
</rss>

