<?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 Formula problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210872#M65296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can then modify your code to work like this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;if(productcode='other' and subcontract&amp;lt;&amp;gt;contract,peek(correctcode),if(subcontract=contract,subproductcode,productcode)) as correctcode;&lt;/P&gt;&lt;P&gt;from .....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this should work fine&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Apr 2010 12:43:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-12T12:43:55Z</dc:date>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210863#M65287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello fellow QV users,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following case, see matrix below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 301pt; border-collapse: collapse;" width="402"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 57pt; mso-width-source: userset; mso-width-alt: 2779;" width="76" /&gt;&lt;COL style="width: 81pt; mso-width-source: userset; mso-width-alt: 3949;" width="108" /&gt;&lt;COL style="width: 80pt; mso-width-source: userset; mso-width-alt: 3913;" width="107" /&gt;&lt;COL style="width: 83pt; mso-width-source: userset; mso-width-alt: 4059;" width="111" /&gt;&lt;/COLGROUP&gt;&lt;TBODY&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl22" height="17" style="width: 57pt; height: 12.75pt; background-color: transparent; border: windowtext 0.5pt solid;" width="76"&gt;CONTRACT&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; border-left: windowtext; width: 81pt; border-bottom: windowtext 0.5pt solid; background-color: transparent;" width="108"&gt;SUB-CONTRACT&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; border-left: windowtext; width: 80pt; border-bottom: windowtext 0.5pt solid; background-color: transparent;" width="107"&gt;PRODUCTCODE&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; border-left: windowtext; width: 83pt; border-bottom: windowtext 0.5pt solid; background-color: transparent;" width="111"&gt;CORRECT CODE&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 12.75pt; background-color: transparent;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;1&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;mt-10&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;mt-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 12.75pt; background-color: transparent;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;2&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;other&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;mt-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 12.75pt; background-color: transparent;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;3&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;other&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;mt-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 12.75pt; background-color: transparent;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;4&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;other&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;mt-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 12.75pt; background-color: transparent;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;5&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;other&lt;/TD&gt;&lt;TD class="xl22" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;mt-10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a contract named A and this contract has 5 subcontracts one of these has a productcode 'MT-10' the other sub-contracts are named 'OTHER'. How can I create the result as shown in column CORRECT CODE (every sub-contract should be named (MT-10). Be aware that there are 25 PRODUCTCODES, each contract has one PRODUCTCODE NAME and the other sub- contracts are also named other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aissam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 08:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210863#M65287</guid>
      <dc:creator />
      <dc:date>2010-04-12T08:50:28Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210864#M65288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aissam&lt;/P&gt;&lt;P&gt;Please find the following code bellow. I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt;[Data]:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;CONTRACT, SUBCONTRACT, PRODUCTCODE&lt;BR /&gt;A, 1, mt-10&lt;BR /&gt;A, 2, other&lt;BR /&gt;A, 3, other&lt;BR /&gt;A, 4, other&lt;BR /&gt;A, 5, other&lt;BR /&gt;B, 1, mt-20&lt;BR /&gt;B, 2, other&lt;BR /&gt;B, 3, other&lt;BR /&gt;B, 4, other&lt;BR /&gt;B, 5, other&lt;BR /&gt;C, 1, mt-30&lt;BR /&gt;C, 2, other&lt;BR /&gt;C, 3, other&lt;BR /&gt;C, 4, other&lt;BR /&gt;C, 5, other&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;LEFT JOIN (Data)&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt;CONTRACT,&lt;BR /&gt;PRODUCTCODE AS CORRECTCODE&lt;BR /&gt;RESIDENT [Data]&lt;BR /&gt;WHERE SUBCONTRACT = 1;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 09:22:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210864#M65288</guid>
      <dc:creator>d_pranskus</dc:creator>
      <dc:date>2010-04-12T09:22:36Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210865#M65289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use the previous and peek functions to create the Correcr Column which is required.Create the column with a condition like if previous Contract Name is similar then copy the same Product Code column to Correct Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 09:25:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210865#M65289</guid>
      <dc:creator>spsrk_84</dc:creator>
      <dc:date>2010-04-12T09:25:14Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210866#M65290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;The inline function is not a possibility because we have at least 500.000 Contracts :-).&lt;/P&gt;&lt;P&gt;Ajay;&lt;/P&gt;&lt;P&gt;I don't understand the Peek function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aissam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 09:34:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210866#M65290</guid>
      <dc:creator />
      <dc:date>2010-04-12T09:34:10Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210867#M65291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;The inline function was used just to introduce the data, to have something to work with. Please see the second sentence. It finds a correct product code for every contract where subcontract number is 1. If it does not help you please attach some excerpt of your data exported to excel file and I try to figure it out.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Darius&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 09:41:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210867#M65291</guid>
      <dc:creator>d_pranskus</dc:creator>
      <dc:date>2010-04-12T09:41:09Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210868#M65292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darius,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Contract and subcontract are both unique. Attached you will find an excel file with some data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aissam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 10:23:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210868#M65292</guid>
      <dc:creator />
      <dc:date>2010-04-12T10:23:46Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210869#M65293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the peek function to create the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;if(subcontract='other',peek(correctcode),subcontract) as correctcode;&lt;/P&gt;&lt;P&gt;from .....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this should work fine&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 10:25:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210869#M65293</guid>
      <dc:creator />
      <dc:date>2010-04-12T10:25:57Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210870#M65294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tauqueer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Let's make it a step complicater. We also have contracts that have one subcontract (CONTRACT AND SUBCONTRACT are the same). These contracts have a PRODUCTCODE &lt;STRONG&gt;'OTHER'&lt;/STRONG&gt;. We also have a SUBPRODUCTCODE, in these case it would be 'SPAREPARTS'. I would like to create the following formula.&lt;/P&gt;&lt;P&gt;If the result of forumula (&lt;STRONG&gt;&lt;EM&gt;if(subcontract='other',peek(correctcode),subcontract) as correctcode;) = 'other'&lt;/EM&gt; then&lt;/STRONG&gt; look in field SUBPRODUCTCODE. Below I have created a matrix where you can see what I mean. The CORRECT CODE for CONTRACT 09W5000 = SPAREPARTS and not 'OTHER' See matrix below row 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width:405pt;border-collapse:collapse;" width="541"&gt;&lt;COLGROUP&gt;&lt;COL style="width:57pt;mso-width-source:userset;mso-width-alt:2779;" width="76" /&gt;&lt;COL style="width:84pt;mso-width-source:userset;mso-width-alt:4096;" width="112" /&gt;&lt;COL style="width:80pt;mso-width-source:userset;mso-width-alt:3913;" width="107" /&gt;&lt;COL style="width:101pt;mso-width-source:userset;mso-width-alt:4937;" width="135" /&gt;&lt;COL style="width:83pt;mso-width-source:userset;mso-width-alt:4059;" width="111" /&gt;&lt;/COLGROUP&gt;&lt;TBODY&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD class="xl22" height="17" style="width:57pt;height:12.75pt;background-color:transparent;border:windowtext 0.5pt solid;" width="76"&gt;CONTRACT&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext 0.5pt solid;border-left:windowtext;width:84pt;border-bottom:windowtext 0.5pt solid;background-color:transparent;" width="112"&gt;SUB-CONTRACT&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext 0.5pt solid;border-left:windowtext;width:80pt;border-bottom:windowtext 0.5pt solid;background-color:transparent;" width="107"&gt;PRODUCTCODE&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext 0.5pt solid;border-left:windowtext;width:101pt;border-bottom:windowtext 0.5pt solid;background-color:transparent;" width="135"&gt;SUBPRODUCTCODE&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext 0.5pt solid;border-left:windowtext;width:83pt;border-bottom:windowtext 0.5pt solid;background-color:transparent;" width="111"&gt;CORRECT CODE&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext 0.5pt solid;border-bottom:windowtext 0.5pt solid;height:12.75pt;background-color:transparent;"&gt;C09W3610&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;09W3611&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;MT-10&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;MT-10&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;MT-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext 0.5pt solid;border-bottom:windowtext 0.5pt solid;height:12.75pt;background-color:transparent;"&gt;C09W3610&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;09W3612&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;OTHER&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;TANK&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;MT-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext 0.5pt solid;border-bottom:windowtext 0.5pt solid;height:12.75pt;background-color:transparent;"&gt;C09W3610&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;09W3613&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;OTHER&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;SPAREPARTS&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;MT-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext 0.5pt solid;border-bottom:windowtext 0.5pt solid;height:12.75pt;background-color:transparent;"&gt;C09W3610&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;09W3614&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;OTHER&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;HYDROLIC&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;MT-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD class="xl22" height="17" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext 0.5pt solid;border-bottom:windowtext 0.5pt solid;height:12.75pt;background-color:transparent;"&gt;09W5000&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;09W5000&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;OTHER&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;SPAREPARTS&lt;/TD&gt;&lt;TD class="xl22" style="border-right:windowtext 0.5pt solid;border-top:windowtext;border-left:windowtext;border-bottom:windowtext 0.5pt solid;background-color:transparent;"&gt;SPAREPARTS&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is clear for you :-),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aissam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 11:20:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210870#M65294</guid>
      <dc:creator />
      <dc:date>2010-04-12T11:20:16Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210871#M65295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;[Data]:&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt; CONTRACT,&lt;/P&gt;&lt;P&gt;[SUB-CONTRACT],&lt;/P&gt;&lt;P&gt;PRODUCTCODE,&lt;/P&gt;&lt;P&gt;Recno() &lt;B&gt;AS&lt;/B&gt; RecNo&lt;/P&gt;&lt;P&gt;&lt;B&gt;FROM&lt;/B&gt; [data QV forum question.xls] (biff, embedded labels, table is Sheet1$)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P style="font-style: italic"&gt;[tmp]:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;P&gt;CONTRACT,&lt;/P&gt;&lt;P&gt;PRODUCTCODE,&lt;/P&gt;&lt;P&gt;RecNo &lt;B&gt;AS&lt;/B&gt; RecNo1&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; [Data]&lt;/P&gt;&lt;P&gt;&lt;B&gt;WHERE&lt;/B&gt; PRODUCTCODE &amp;lt;&amp;gt; 'Other'&lt;/P&gt;&lt;P&gt;&lt;B&gt;ORDER&lt;/B&gt; &lt;B&gt;BY&lt;/B&gt; RecNo DESC;&lt;/P&gt;&lt;P&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt; (&lt;I&gt;tmp&lt;/I&gt;)&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;P&gt;CONTRACT,&lt;/P&gt;&lt;P&gt;PRODUCTCODE,&lt;/P&gt;&lt;P&gt;RecNo1,&lt;/P&gt;&lt;P&gt;IF(CONTRACT = PEEK(CONTRACT), PEEK(RecNo1)-1, 99999999) &lt;B&gt;AS&lt;/B&gt; RecNo2&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; [tmp];&lt;/P&gt;&lt;P&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt; (&lt;I&gt;[Data]&lt;/I&gt;)&lt;/P&gt;&lt;P&gt;INTERVALMATCH (RecNo, CONTRACT)&lt;/P&gt;&lt;P&gt;LOAD RecNo1, RecNo2, CONTRACT RESIDENT tmp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt; (&lt;I&gt;[Data]&lt;/I&gt;)&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;P&gt;CONTRACT,&lt;/P&gt;&lt;P&gt;RecNo1,&lt;/P&gt;&lt;P&gt;RecNo2,&lt;/P&gt;&lt;P&gt;PRODUCTCODE &lt;B&gt;AS&lt;/B&gt; CORRECTPRODUCT&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; tmp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;DROP&lt;/B&gt; &lt;B&gt;TABLE&lt;/B&gt; &lt;I&gt;tmp;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;DROP&lt;/B&gt; &lt;I&gt;FIELDS&lt;/I&gt; &lt;I&gt;RecNo&lt;/I&gt;, &lt;I&gt;RecNo1&lt;/I&gt;, &lt;I&gt;RecNo2;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should modify the code to meet your last requirement just by adding one load statment and the condition&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;CONTRACT,&lt;/P&gt;&lt;P&gt;SUB-CONTRACT,&lt;/P&gt;&lt;P&gt;PRODUCTCODE,&lt;/P&gt;&lt;P&gt;IF(CONTRACT=SUBCONTRACT AND PRODUCTCODE='Other', SUBPRODUCTCODE, CORRECTCODE) AS CORRECTCODE&lt;/P&gt;&lt;P&gt;RESIDENT [Data];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 11:30:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210871#M65295</guid>
      <dc:creator>d_pranskus</dc:creator>
      <dc:date>2010-04-12T11:30:17Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210872#M65296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can then modify your code to work like this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;if(productcode='other' and subcontract&amp;lt;&amp;gt;contract,peek(correctcode),if(subcontract=contract,subproductcode,productcode)) as correctcode;&lt;/P&gt;&lt;P&gt;from .....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this should work fine&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 12:43:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210872#M65296</guid>
      <dc:creator />
      <dc:date>2010-04-12T12:43:55Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210873#M65297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will see if it works, can take a few days, but I will let you know. Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aissam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 12:49:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210873#M65297</guid>
      <dc:creator />
      <dc:date>2010-04-12T12:49:24Z</dc:date>
    </item>
    <item>
      <title>Formula problem</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210874#M65298</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;It took me a few days but it works, thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aissam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 13:16:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-problem/m-p/210874#M65298</guid>
      <dc:creator />
      <dc:date>2010-04-27T13:16:41Z</dc:date>
    </item>
  </channel>
</rss>

