<?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 Re: Error in First Value expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509033#M600211</link>
    <description>&lt;P&gt;No,&lt;BR /&gt;In my originaly formula, it was necessary to take last value of Date(the red square on the print screen) , but later we understood that date should be, the last one, before second ME21N(on the print screen it is green square).&lt;BR /&gt;So I decided to make a key-&lt;SPAN&gt;FINAL_FLAG. Than another&amp;nbsp;Flag, which indicates where is necessary&amp;nbsp;ME21N (in source it could be 3-4 times of this&amp;nbsp;ME21N).&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;So the easiest way was, to take FirstValue of ME21NU (U-is indicator) and minus 1. So we&amp;nbsp;will take date, which we need.&lt;BR /&gt;All steps and keys in above part of script, which I attached are working, but when it begins expression FirstValue, there is 0 data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.jpg" style="width: 192px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/570i9D6EB3470533CDCB/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Nov 2018 12:37:11 GMT</pubDate>
    <dc:creator>ivanaksen</dc:creator>
    <dc:date>2018-11-19T12:37:11Z</dc:date>
    <item>
      <title>Error in First Value expression</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1508887#M600209</link>
      <description>&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;Please support with bellow question:&lt;/P&gt;&lt;P&gt;I have a task in script to take data which is very previous before first value "&lt;SPAN&gt;ME21NU".&lt;BR /&gt;But the problem that when I am making expression &lt;FONT color="#FF0000"&gt;FirstValue(FINAL_FLAG)-1 as Indicator,&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;I dont have any data,&amp;nbsp; but &lt;/FONT&gt;NULL. Can you support, how it should looks like?&amp;nbsp;&lt;BR /&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TCODE&amp;amp;CHANGE_IND&amp;amp;AutoNumber(CHANGENR&amp;amp;TCODE&amp;amp;CHANGE_IND) as FINAL_FLAG&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CDHDR_TMP2:&lt;BR /&gt;load *,&lt;BR /&gt;If(Left(FINAL_FLAG,6)='ME21NU',1,0) as Flag&lt;BR /&gt;resident CDHDR_TMP;&lt;BR /&gt;drop table CDHDR_TMP;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;CDHDR_IND:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;CDHDR_KEY,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Flag,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;FirstValue(FINAL_FLAG)-1 as Indicator&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;resident CDHDR_TMP2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;where Flag=1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;group by CDHDR_KEY,Flag;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Left join (CDHDR_TMP2)&lt;BR /&gt;Load*&lt;BR /&gt;resident CDHDR_IND;&lt;BR /&gt;Drop Table CDHDR_IND;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CDHDR:&lt;BR /&gt;Load*,&lt;BR /&gt;TCODE as TCODE1&lt;BR /&gt;resident CDHDR_TMP2&lt;BR /&gt;where Indicator=1;&lt;BR /&gt;Drop table CDHDR_TMP2;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:52:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1508887#M600209</guid>
      <dc:creator>ivanaksen</dc:creator>
      <dc:date>2024-11-16T21:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error in First Value expression</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509017#M600210</link>
      <description>Are you looking to get the second value? May be you need to use another way to do this? Would you be able to share some sample data to show the kind of data you have (dummy mocked up data will work to) and explain what you are looking to get from it?</description>
      <pubDate>Mon, 19 Nov 2018 12:21:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509017#M600210</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-11-19T12:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error in First Value expression</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509033#M600211</link>
      <description>&lt;P&gt;No,&lt;BR /&gt;In my originaly formula, it was necessary to take last value of Date(the red square on the print screen) , but later we understood that date should be, the last one, before second ME21N(on the print screen it is green square).&lt;BR /&gt;So I decided to make a key-&lt;SPAN&gt;FINAL_FLAG. Than another&amp;nbsp;Flag, which indicates where is necessary&amp;nbsp;ME21N (in source it could be 3-4 times of this&amp;nbsp;ME21N).&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;So the easiest way was, to take FirstValue of ME21NU (U-is indicator) and minus 1. So we&amp;nbsp;will take date, which we need.&lt;BR /&gt;All steps and keys in above part of script, which I attached are working, but when it begins expression FirstValue, there is 0 data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.jpg" style="width: 192px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/570i9D6EB3470533CDCB/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 12:37:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509033#M600211</guid>
      <dc:creator>ivanaksen</dc:creator>
      <dc:date>2018-11-19T12:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error in First Value expression</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509044#M600212</link>
      <description>&lt;P&gt;I would do something like this&lt;/P&gt;&lt;PRE&gt;Table:
LOAD TCode,
 Max(Date) as MaxDate
Resident ....
Group By TCode;

Final:
LOAD FirstSortedValue(TCode, -MaxDate, 2) as Max2TCode
Resident Table;

DROP Table Table;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Nov 2018 12:44:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509044#M600212</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-11-19T12:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error in First Value expression</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509056#M600213</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please remember to post questions related to the product in the correct discussion board.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the list of discussion board for qlik products,&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Products/ct-p/qlik-products" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Products/ct-p/qlik-products&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This post will be moved to the correct discussion board soon.&lt;/P&gt;&lt;P&gt;Thanks,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Pablo&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 12:51:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509056#M600213</guid>
      <dc:creator>pablolabbe</dc:creator>
      <dc:date>2018-11-19T12:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error in First Value expression</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509166#M600215</link>
      <description>&lt;P&gt;&lt;SPAN&gt;unfortunately it doesnt work, i have no data after all &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried some variations with your variant, but still no result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any Idea, why my FirstValue expression doesn`t work??&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 15:27:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509166#M600215</guid>
      <dc:creator>ivanaksen</dc:creator>
      <dc:date>2018-11-19T15:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error in First Value expression</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509169#M600216</link>
      <description>Because I don't think FirstValue can look at SecondValue just because you are doing -1 :)... Sorry, with the amount of information you are providing... it will not be easy to help you.&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Sunny</description>
      <pubDate>Mon, 19 Nov 2018 15:39:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-First-Value-expression/m-p/1509169#M600216</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-11-19T15:39:08Z</dc:date>
    </item>
  </channel>
</rss>

