<?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: How to implement the below query in Qlikview in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889119#M1016023</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is from QV help section, this can be done, but I guess it would be better if you understood the whole thing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;A name="kanchor798"&gt;&lt;/A&gt;Load&lt;/H1&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;load&lt;/SPAN&gt; statement loads fields from a file, from data defined in the script, from a previously loaded table, from a web page, from the result of a subsequent &lt;SPAN class="Bold"&gt;select&lt;/SPAN&gt; statement or by generating data automatically. The general syntax of the load statement is:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;load&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; [ &lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;distinct&lt;/A&gt;&lt;SPAN class="Italic"&gt; ] &lt;/SPAN&gt;*&lt;SPAN class="Italic"&gt;fieldlist&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[( &lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;from&lt;/A&gt;&lt;SPAN class="Italic"&gt; file [ format-spec ]&lt;/SPAN&gt; | &lt;/P&gt;&lt;P class="syntax"&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;from_field&lt;/A&gt;&lt;SPAN class="Italic"&gt; fieldassource [format-spec&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;]&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;inline&lt;/A&gt;&lt;SPAN class="Italic"&gt; data [ format-spec ]&lt;/SPAN&gt; | &lt;/P&gt;&lt;P class="syntax"&gt;&lt;A href="https://community.qlik.com/"&gt;resident&lt;/A&gt;&lt;SPAN class="Italic"&gt; table-label&lt;/SPAN&gt; | &lt;/P&gt;&lt;P class="syntax"&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;autogenerate&lt;/A&gt;&lt;SPAN class="Italic"&gt; size )]&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[ &lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;where&lt;/A&gt;&lt;SPAN class="Italic"&gt; criterion&lt;/SPAN&gt; | &lt;A class="Bold" href="https://community.qlik.com/"&gt;while&lt;/A&gt;&lt;SPAN class="Italic"&gt; criterion ]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[ &lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;group_by&lt;/A&gt;&lt;SPAN class="Italic"&gt; groupbyfieldlist ]&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[&lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;order_by&lt;/A&gt;&lt;SPAN class="Italic"&gt; orderbyfieldlist ]&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;where:&lt;/P&gt;&lt;P&gt;&lt;A name="kanchor799"&gt;&lt;/A&gt;&lt;A name="distinct"&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;distinct&lt;/SPAN&gt; is a predicate used if only the first of duplicate records should be loaded. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;*fieldlist ::= ( * | field { &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;,&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; field } )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;A list of the fields to be loaded. Using * as field list indicates all fields in the table. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;field ::= ( fieldref &lt;/SPAN&gt;|&lt;SPAN class="Italic"&gt; expression ) [ &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;as&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; aliasname ]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The field definition must always contain a literal, a reference to an existing field, or an expression. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;fieldref ::= ( fieldname &lt;/SPAN&gt;|@&lt;SPAN class="Italic"&gt;fieldnumber &lt;/SPAN&gt;|@&lt;SPAN class="Italic"&gt;startpos:endpos [ &lt;SPAN class="Bold"&gt;I&lt;/SPAN&gt; | &lt;SPAN class="Bold"&gt;U&lt;/SPAN&gt; | &lt;SPAN class="Bold"&gt;R&lt;/SPAN&gt;| &lt;SPAN class="Bold"&gt;B&lt;/SPAN&gt;&lt;/SPAN&gt; ] )&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt; is a text that is identical to a field name in the table. Note that the field name must be enclosed by straight double quotation marks or square brackets if it contains e.g. spaces. Sometimes field names are not explicitly available. Then a different notation is used:&lt;/P&gt;&lt;P&gt;@&lt;SPAN class="Italic"&gt;fieldnumber&lt;/SPAN&gt; represents the field number in a delimited table file. It must be a positive integer preceded by "@". The numbering is always made from 1 and up to the number of fields. &lt;/P&gt;&lt;P&gt;@&lt;SPAN class="Italic"&gt;startpos&lt;/SPAN&gt;:&lt;SPAN class="Italic"&gt;endpos&lt;/SPAN&gt; represents the start and end positions of a field in a file with fixed length records. The positions must both be positive integers. The two numbers must be preceded by "@" and separated by a colon. The numbering is always made from 1 and up to the number of positions. If @&lt;SPAN class="Italic"&gt;startpos&lt;/SPAN&gt;:&lt;SPAN class="Italic"&gt;endpos&lt;/SPAN&gt; is immediately followed by the characters &lt;SPAN class="Bold"&gt;I&lt;/SPAN&gt; or &lt;SPAN class="Bold"&gt;U&lt;/SPAN&gt;, the bytes read will be interpreted as a binary signed (&lt;SPAN class="Bold"&gt;I&lt;/SPAN&gt;) or unsigned (&lt;SPAN class="Bold"&gt;U&lt;/SPAN&gt;) integer (Intel byte order). The number of positions read must be 1, 2 or 4. If @&lt;SPAN class="Italic"&gt;startpos:endpos&lt;/SPAN&gt; is immediately followed by the character &lt;SPAN class="Bold"&gt;R&lt;/SPAN&gt;, the bytes read will be interpreted as a binary real number (IEEE 32-bit or 64 bit floating point). The number of positions read must be 4 or 8. If @&lt;SPAN class="Italic"&gt;startpos:endpos&lt;/SPAN&gt; is immediately followed by the character &lt;SPAN class="Bold"&gt;B&lt;/SPAN&gt;, the bytes read will be interpreted as a BCD (Binary Coded Decimal) numbers according to the COMP-3 standard. Any number of bytes may be specified. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; can be a numeric function or a string function based on one or several other fields in the same table. For further information, see the syntax of &lt;A class="MCXref_0"&gt;&lt;EM&gt;Script Expressions&lt;/EM&gt;&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor800"&gt;&lt;/A&gt;&lt;A name="as"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;as&lt;/SPAN&gt; is used for assigning a new name to the field. &lt;/P&gt;&lt;P class="note"&gt;&lt;STRONG&gt;Note!&lt;/STRONG&gt; &lt;BR /&gt;If a table contains two fields with the same field name, typically when loading from a text file,only one field can be loaded even though the field names have been changed using &lt;SPAN class="Bold"&gt;as&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor801"&gt;&lt;/A&gt;&lt;A name="from"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;from&lt;/SPAN&gt; is used if data should be loaded from a file. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;file ::= [ path ] filename&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The path is the path to the file, either absolute, or relative to the QlikView document (.qvw file). If the path is omitted, QlikView searches for the file in the directory specified by the directory statement. If there is no directory statement, QlikView searches in the working directory, which is usually the directory in which the QlikView file is located. The path may also be a URL address (HTTP or FTP), pointing to a location on the Internet or an intranet. &lt;/P&gt;&lt;P&gt;The &lt;SPAN class="Italic"&gt;filename&lt;/SPAN&gt; may contain the standard DOS wildcard characters ( * and ? ). This will cause all the matching files in the specified directory to be loaded. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;format-spec ::= ( fspec-item { , fspec-item } )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The format specification consists of a list of several &lt;A class="MCXref_0"&gt;&lt;EM&gt;Format Specification Items&lt;/EM&gt;&lt;/A&gt;, within brackets. &lt;/P&gt;&lt;P&gt;&lt;A name="from_field"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;from_field&lt;/SPAN&gt; is used if data should be loaded from a previously loaded field. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;fieldassource ::= &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;tablename, fieldname&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The field is the name of the previously loaded &lt;SPAN class="Italic"&gt;tablename&lt;/SPAN&gt; and &lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;format-spec ::= ( fspec-item {, fspec-item } )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The format specification consists of a list of several &lt;A class="MCXref_0"&gt;&lt;EM&gt;Format Specification Items&lt;/EM&gt;&lt;/A&gt;, within brackets. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor802"&gt;&lt;/A&gt;&lt;A name="inline"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;inline&lt;/SPAN&gt; is used if data should be typed within the script, and not loaded from a file. Use the &lt;A class="MCXref_0"&gt;&lt;EM&gt;Inline Data Wizard&lt;/EM&gt;&lt;/A&gt; for help with the creation of&lt;SPAN class="Bold"&gt; load inline&lt;/SPAN&gt; statements. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;data ::= [ text ]&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Data entered through an &lt;SPAN class="Bold"&gt;inline&lt;/SPAN&gt; clause must be enclosed by double &lt;A class="MCXref_0"&gt;&lt;EM&gt;Quotation Marks in Scripting&lt;/EM&gt;&lt;/A&gt; or with square brackets. The text between these is interpreted in the same way as the content of a file. Hence, where you would insert a new line in a text file, you should also do it in the text of an &lt;SPAN class="Bold"&gt;inline&lt;/SPAN&gt; clause, i.e. by pressing the Enter key when typing the script. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor803"&gt;&lt;/A&gt;&lt;A name="resident"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;resident&lt;/SPAN&gt; is used if data should be loaded from a previously loaded table. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;table label&lt;/SPAN&gt; is a label preceding the &lt;SPAN class="Bold"&gt;load&lt;/SPAN&gt; or &lt;SPAN class="Bold"&gt;select&lt;/SPAN&gt; statement(s) that created the original table. The label should be given with a colon at the end. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor804"&gt;&lt;/A&gt;&lt;A name="autogenerate"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;autogenerate&lt;/SPAN&gt; is used if data should be automatically generated by QlikView. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;size ::= number&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Number&lt;/SPAN&gt; is an integer indicating the number of records to be generated. The field list must not contain expressions which require data from a database. Only constants and parameter-free functions (e.g. rand(), recno()) are allowed in the expressions. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor805"&gt;&lt;/A&gt;&lt;A name="where"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;where&lt;/SPAN&gt; is a clause used for stating whether a record should be included in the selection or not. The selection is included if &lt;SPAN class="Italic"&gt;criterion&lt;/SPAN&gt; is true. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor806"&gt;&lt;/A&gt;&lt;A name="while"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;while&lt;/SPAN&gt; is a clause used for stating whether a record should be repeatedly read. The same record is read as long as &lt;SPAN class="Italic"&gt;criterion&lt;/SPAN&gt; is true. In order to be useful, a &lt;SPAN class="Bold"&gt;while&lt;/SPAN&gt; clause must typically include the &lt;SPAN class="Bold"&gt;IterNo( )&lt;/SPAN&gt; function. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;criterion&lt;/SPAN&gt; is a logical expression. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor807"&gt;&lt;/A&gt;&lt;A name="group_by"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;group by&lt;/SPAN&gt; is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;groupbyfieldlist ::= (fieldname { ,fieldname } )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor808"&gt;&lt;/A&gt;&lt;A name="order_by"&gt;&lt;/A&gt;&lt;SPAN class="Italic"&gt;order by&lt;/SPAN&gt; is a clause used for sorting the records of a resident table before they are processed by the &lt;SPAN class="Bold"&gt;load&lt;/SPAN&gt; statement. The resident table can be sorted by one or more fields in ascending or descending order. The sorting is made primarily by numeric value and secondarily by national ASCII value. This clause may only be used when the data source is a resident table. The ordering fields specify which fields the resident table is sorted by. The field can be specified by its name or by its number in the resident table (the first field is number 1). &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;orderbyfieldlist ::= fieldname [ sortorder ] { , fieldname [ sortorder ] }&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;sortorder&lt;/SPAN&gt; is either asc for ascending or desc for descending. If no &lt;SPAN class="Italic"&gt;sortorder&lt;/SPAN&gt; is specified, asc is assumed. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt;, &lt;SPAN class="Italic"&gt;path&lt;/SPAN&gt;, &lt;SPAN class="Italic"&gt;filename&lt;/SPAN&gt; and &lt;SPAN class="Italic"&gt;aliasname&lt;/SPAN&gt; are text strings representing what the respective names imply. Any field in the source table can be used as &lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt;. However, fields created through the as clause (&lt;SPAN class="Italic"&gt;aliasname&lt;/SPAN&gt;) are out of scope and cannot be used inside the same load statement.&lt;/P&gt;&lt;P class="note"&gt;&lt;SPAN class="Bold"&gt;Note!&lt;/SPAN&gt; &lt;BR /&gt;If no source of data is given by means of a from, inline, resident, from field or autogenerate clause, data will be loaded from the result of the immediately succeeding select or load statement. The succeeding statement should not have a prefix. &lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P&gt;Different file formats &lt;/P&gt;&lt;P class="Code"&gt;Load * from data1.csv; &lt;/P&gt;&lt;P class="Code"&gt;Load * from 'c:\userfiles\data1.csv' (ansi, txt, delimiter is ',', embedded labels); &lt;/P&gt;&lt;P class="Code"&gt;Load * from 'c:\userfiles\data2.txt' (ansi, txt, delimiter is '\t', embedded labels); &lt;/P&gt;&lt;P class="Code"&gt;Load * from file2.dif (ansi, dif, embedded labels); &lt;/P&gt;&lt;P class="Code"&gt;Load @1:2 as ID, @3:25 as Name, @57:80 as City from data4.fix (ansi, fix, no labels, header is 0, record is 80); &lt;/P&gt;&lt;P class="Code"&gt;Load * from C:\qdssamples\xyz.qvx (qvx); &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Selecting certain fields, calculating fields&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load FirstName, LastName, Number from data1.csv; &lt;/P&gt;&lt;P class="Code"&gt;Load @1as A, @2 as B from data3.txt' (ansi, txt, delimiter is '\t', no labels); &lt;/P&gt;&lt;P class="Code"&gt;Load FirstName&amp;amp;' '&amp;amp;LastName as Name from data1.csv; &lt;/P&gt;&lt;P class="Code"&gt;Load Quantity, Price, Quantity*Price as Value from data1.csv; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Selecting certain records&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load distinct FirstName, LastName, Number from data1.csv; &lt;/P&gt;&lt;P class="Code"&gt;Load * from Consumption.csv where Litres&amp;gt;0; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Loading data not on file&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load * Inline &lt;/P&gt;&lt;P class="Code"&gt;[CatID, Category &lt;/P&gt;&lt;P class="Code"&gt;0,Regular &lt;/P&gt;&lt;P class="Code"&gt;1,Occasional &lt;/P&gt;&lt;P class="Code"&gt;2,Permanent]; &lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;P class="Code"&gt;Load * Inline [UserID, Password, Access &lt;/P&gt;&lt;P class="Code"&gt;A, ABC456, User &lt;/P&gt;&lt;P class="Code"&gt;B, VIP789, Admin]; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;Load RecNo( ) as A, rand( ) as B autogenerate(10000);&lt;/SPAN&gt;(Note: The parenthesis after autogenerate is allowed but not required.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Loading data from previously loaded table&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;tab1: &lt;/P&gt;&lt;P class="Code"&gt;Select A,B,C,D from transtable; &lt;/P&gt;&lt;P class="Code"&gt;Load A,B,month(C),A*B+D as E resident tab1; &lt;/P&gt;&lt;P class="Code"&gt;Load A,A+B+C resident tab1 where A&amp;gt;B; &lt;/P&gt;&lt;P class="Code"&gt;Load A,B*C as E resident tab1 order by A; &lt;/P&gt;&lt;P class="Code"&gt;Load A,B*C as E resident tab1 order by 1,2; &lt;/P&gt;&lt;P class="Code"&gt;Load A,B*C as E resident tab1 order by C desc, B asc, 1 desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Loading data from previously loaded fields&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load A from_field (Characters, Types);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Loading data from succeeding table&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load A, B, if(C&amp;gt;0,'positive','negative') as X, weekday(D) as Y; &lt;/P&gt;&lt;P class="Code"&gt;Select A,B,C,D from Table1; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Grouping data&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load ArtNo, round(Sum(TransAmount),0.05) as ArtNoTotal from table.csv group by ArtNo; &lt;/P&gt;&lt;P class="Code"&gt;Load Week, ArtNo, round(Avg(TransAmount),0.05) as WeekArtNoAverages from table.csv group by Week, ArtNo; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Reading one record repeatedly&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;My Tab: &lt;/P&gt;&lt;P class="Code"&gt;Load Student, &lt;/P&gt;&lt;P class="Code"&gt;mid(Grades,IterNo( ),1) as Grade, &lt;/P&gt;&lt;P class="Code"&gt;pick(IterNo( ), 'Math', 'English', 'Science', 'History') as Subject from Tab1.csv &lt;/P&gt;&lt;P class="Code"&gt;while mid(Grades,IterNo( ),1)&amp;lt;&amp;gt;' '; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Apr 2015 04:41:19 GMT</pubDate>
    <dc:creator>ramoncova06</dc:creator>
    <dc:date>2015-04-10T04:41:19Z</dc:date>
    <item>
      <title>How to implement the below query in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889118#M1016022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff; font-size: 10pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;number&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; EPISODE C&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; CALENDAR D&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; c&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;start_date &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; d&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;CALENDAR_DATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; d&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;CALENDAR_YEAR &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; F&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;CALENDAR_YEAR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; d&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; F&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; ADM&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff; font-size: 10pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;(g. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;stay_number&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; CALENDAR F&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; EPISODE G&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; F&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;CALENDAR_YEAR &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 10pt;"&gt;'2014'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; F&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;MONTH &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 10pt;"&gt;'Apr'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; F&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;CALENDAR_DATE &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; G&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;episode_end_date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;GROUP&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; F&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;CALENDAR_YEAR&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; F&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;MONTH_SHORT_DESC&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 23:49:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889118#M1016022</guid>
      <dc:creator />
      <dc:date>2015-04-09T23:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement the below query in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889119#M1016023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is from QV help section, this can be done, but I guess it would be better if you understood the whole thing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;A name="kanchor798"&gt;&lt;/A&gt;Load&lt;/H1&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;load&lt;/SPAN&gt; statement loads fields from a file, from data defined in the script, from a previously loaded table, from a web page, from the result of a subsequent &lt;SPAN class="Bold"&gt;select&lt;/SPAN&gt; statement or by generating data automatically. The general syntax of the load statement is:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;load&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; [ &lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;distinct&lt;/A&gt;&lt;SPAN class="Italic"&gt; ] &lt;/SPAN&gt;*&lt;SPAN class="Italic"&gt;fieldlist&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[( &lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;from&lt;/A&gt;&lt;SPAN class="Italic"&gt; file [ format-spec ]&lt;/SPAN&gt; | &lt;/P&gt;&lt;P class="syntax"&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;from_field&lt;/A&gt;&lt;SPAN class="Italic"&gt; fieldassource [format-spec&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;]&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;inline&lt;/A&gt;&lt;SPAN class="Italic"&gt; data [ format-spec ]&lt;/SPAN&gt; | &lt;/P&gt;&lt;P class="syntax"&gt;&lt;A href="https://community.qlik.com/"&gt;resident&lt;/A&gt;&lt;SPAN class="Italic"&gt; table-label&lt;/SPAN&gt; | &lt;/P&gt;&lt;P class="syntax"&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;autogenerate&lt;/A&gt;&lt;SPAN class="Italic"&gt; size )]&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[ &lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;where&lt;/A&gt;&lt;SPAN class="Italic"&gt; criterion&lt;/SPAN&gt; | &lt;A class="Bold" href="https://community.qlik.com/"&gt;while&lt;/A&gt;&lt;SPAN class="Italic"&gt; criterion ]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[ &lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;group_by&lt;/A&gt;&lt;SPAN class="Italic"&gt; groupbyfieldlist ]&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[&lt;/SPAN&gt;&lt;A class="Bold" href="https://community.qlik.com/"&gt;order_by&lt;/A&gt;&lt;SPAN class="Italic"&gt; orderbyfieldlist ]&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;where:&lt;/P&gt;&lt;P&gt;&lt;A name="kanchor799"&gt;&lt;/A&gt;&lt;A name="distinct"&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;distinct&lt;/SPAN&gt; is a predicate used if only the first of duplicate records should be loaded. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;*fieldlist ::= ( * | field { &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;,&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; field } )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;A list of the fields to be loaded. Using * as field list indicates all fields in the table. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;field ::= ( fieldref &lt;/SPAN&gt;|&lt;SPAN class="Italic"&gt; expression ) [ &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;as&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; aliasname ]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The field definition must always contain a literal, a reference to an existing field, or an expression. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;fieldref ::= ( fieldname &lt;/SPAN&gt;|@&lt;SPAN class="Italic"&gt;fieldnumber &lt;/SPAN&gt;|@&lt;SPAN class="Italic"&gt;startpos:endpos [ &lt;SPAN class="Bold"&gt;I&lt;/SPAN&gt; | &lt;SPAN class="Bold"&gt;U&lt;/SPAN&gt; | &lt;SPAN class="Bold"&gt;R&lt;/SPAN&gt;| &lt;SPAN class="Bold"&gt;B&lt;/SPAN&gt;&lt;/SPAN&gt; ] )&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt; is a text that is identical to a field name in the table. Note that the field name must be enclosed by straight double quotation marks or square brackets if it contains e.g. spaces. Sometimes field names are not explicitly available. Then a different notation is used:&lt;/P&gt;&lt;P&gt;@&lt;SPAN class="Italic"&gt;fieldnumber&lt;/SPAN&gt; represents the field number in a delimited table file. It must be a positive integer preceded by "@". The numbering is always made from 1 and up to the number of fields. &lt;/P&gt;&lt;P&gt;@&lt;SPAN class="Italic"&gt;startpos&lt;/SPAN&gt;:&lt;SPAN class="Italic"&gt;endpos&lt;/SPAN&gt; represents the start and end positions of a field in a file with fixed length records. The positions must both be positive integers. The two numbers must be preceded by "@" and separated by a colon. The numbering is always made from 1 and up to the number of positions. If @&lt;SPAN class="Italic"&gt;startpos&lt;/SPAN&gt;:&lt;SPAN class="Italic"&gt;endpos&lt;/SPAN&gt; is immediately followed by the characters &lt;SPAN class="Bold"&gt;I&lt;/SPAN&gt; or &lt;SPAN class="Bold"&gt;U&lt;/SPAN&gt;, the bytes read will be interpreted as a binary signed (&lt;SPAN class="Bold"&gt;I&lt;/SPAN&gt;) or unsigned (&lt;SPAN class="Bold"&gt;U&lt;/SPAN&gt;) integer (Intel byte order). The number of positions read must be 1, 2 or 4. If @&lt;SPAN class="Italic"&gt;startpos:endpos&lt;/SPAN&gt; is immediately followed by the character &lt;SPAN class="Bold"&gt;R&lt;/SPAN&gt;, the bytes read will be interpreted as a binary real number (IEEE 32-bit or 64 bit floating point). The number of positions read must be 4 or 8. If @&lt;SPAN class="Italic"&gt;startpos:endpos&lt;/SPAN&gt; is immediately followed by the character &lt;SPAN class="Bold"&gt;B&lt;/SPAN&gt;, the bytes read will be interpreted as a BCD (Binary Coded Decimal) numbers according to the COMP-3 standard. Any number of bytes may be specified. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; can be a numeric function or a string function based on one or several other fields in the same table. For further information, see the syntax of &lt;A class="MCXref_0"&gt;&lt;EM&gt;Script Expressions&lt;/EM&gt;&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor800"&gt;&lt;/A&gt;&lt;A name="as"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;as&lt;/SPAN&gt; is used for assigning a new name to the field. &lt;/P&gt;&lt;P class="note"&gt;&lt;STRONG&gt;Note!&lt;/STRONG&gt; &lt;BR /&gt;If a table contains two fields with the same field name, typically when loading from a text file,only one field can be loaded even though the field names have been changed using &lt;SPAN class="Bold"&gt;as&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor801"&gt;&lt;/A&gt;&lt;A name="from"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;from&lt;/SPAN&gt; is used if data should be loaded from a file. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;file ::= [ path ] filename&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The path is the path to the file, either absolute, or relative to the QlikView document (.qvw file). If the path is omitted, QlikView searches for the file in the directory specified by the directory statement. If there is no directory statement, QlikView searches in the working directory, which is usually the directory in which the QlikView file is located. The path may also be a URL address (HTTP or FTP), pointing to a location on the Internet or an intranet. &lt;/P&gt;&lt;P&gt;The &lt;SPAN class="Italic"&gt;filename&lt;/SPAN&gt; may contain the standard DOS wildcard characters ( * and ? ). This will cause all the matching files in the specified directory to be loaded. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;format-spec ::= ( fspec-item { , fspec-item } )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The format specification consists of a list of several &lt;A class="MCXref_0"&gt;&lt;EM&gt;Format Specification Items&lt;/EM&gt;&lt;/A&gt;, within brackets. &lt;/P&gt;&lt;P&gt;&lt;A name="from_field"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;from_field&lt;/SPAN&gt; is used if data should be loaded from a previously loaded field. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;fieldassource ::= &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;tablename, fieldname&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The field is the name of the previously loaded &lt;SPAN class="Italic"&gt;tablename&lt;/SPAN&gt; and &lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;format-spec ::= ( fspec-item {, fspec-item } )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The format specification consists of a list of several &lt;A class="MCXref_0"&gt;&lt;EM&gt;Format Specification Items&lt;/EM&gt;&lt;/A&gt;, within brackets. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor802"&gt;&lt;/A&gt;&lt;A name="inline"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;inline&lt;/SPAN&gt; is used if data should be typed within the script, and not loaded from a file. Use the &lt;A class="MCXref_0"&gt;&lt;EM&gt;Inline Data Wizard&lt;/EM&gt;&lt;/A&gt; for help with the creation of&lt;SPAN class="Bold"&gt; load inline&lt;/SPAN&gt; statements. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;data ::= [ text ]&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Data entered through an &lt;SPAN class="Bold"&gt;inline&lt;/SPAN&gt; clause must be enclosed by double &lt;A class="MCXref_0"&gt;&lt;EM&gt;Quotation Marks in Scripting&lt;/EM&gt;&lt;/A&gt; or with square brackets. The text between these is interpreted in the same way as the content of a file. Hence, where you would insert a new line in a text file, you should also do it in the text of an &lt;SPAN class="Bold"&gt;inline&lt;/SPAN&gt; clause, i.e. by pressing the Enter key when typing the script. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor803"&gt;&lt;/A&gt;&lt;A name="resident"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;resident&lt;/SPAN&gt; is used if data should be loaded from a previously loaded table. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;table label&lt;/SPAN&gt; is a label preceding the &lt;SPAN class="Bold"&gt;load&lt;/SPAN&gt; or &lt;SPAN class="Bold"&gt;select&lt;/SPAN&gt; statement(s) that created the original table. The label should be given with a colon at the end. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor804"&gt;&lt;/A&gt;&lt;A name="autogenerate"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;autogenerate&lt;/SPAN&gt; is used if data should be automatically generated by QlikView. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;size ::= number&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Number&lt;/SPAN&gt; is an integer indicating the number of records to be generated. The field list must not contain expressions which require data from a database. Only constants and parameter-free functions (e.g. rand(), recno()) are allowed in the expressions. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor805"&gt;&lt;/A&gt;&lt;A name="where"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;where&lt;/SPAN&gt; is a clause used for stating whether a record should be included in the selection or not. The selection is included if &lt;SPAN class="Italic"&gt;criterion&lt;/SPAN&gt; is true. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor806"&gt;&lt;/A&gt;&lt;A name="while"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;while&lt;/SPAN&gt; is a clause used for stating whether a record should be repeatedly read. The same record is read as long as &lt;SPAN class="Italic"&gt;criterion&lt;/SPAN&gt; is true. In order to be useful, a &lt;SPAN class="Bold"&gt;while&lt;/SPAN&gt; clause must typically include the &lt;SPAN class="Bold"&gt;IterNo( )&lt;/SPAN&gt; function. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;criterion&lt;/SPAN&gt; is a logical expression. &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor807"&gt;&lt;/A&gt;&lt;A name="group_by"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;group by&lt;/SPAN&gt; is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;groupbyfieldlist ::= (fieldname { ,fieldname } )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor808"&gt;&lt;/A&gt;&lt;A name="order_by"&gt;&lt;/A&gt;&lt;SPAN class="Italic"&gt;order by&lt;/SPAN&gt; is a clause used for sorting the records of a resident table before they are processed by the &lt;SPAN class="Bold"&gt;load&lt;/SPAN&gt; statement. The resident table can be sorted by one or more fields in ascending or descending order. The sorting is made primarily by numeric value and secondarily by national ASCII value. This clause may only be used when the data source is a resident table. The ordering fields specify which fields the resident table is sorted by. The field can be specified by its name or by its number in the resident table (the first field is number 1). &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;orderbyfieldlist ::= fieldname [ sortorder ] { , fieldname [ sortorder ] }&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;sortorder&lt;/SPAN&gt; is either asc for ascending or desc for descending. If no &lt;SPAN class="Italic"&gt;sortorder&lt;/SPAN&gt; is specified, asc is assumed. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt;, &lt;SPAN class="Italic"&gt;path&lt;/SPAN&gt;, &lt;SPAN class="Italic"&gt;filename&lt;/SPAN&gt; and &lt;SPAN class="Italic"&gt;aliasname&lt;/SPAN&gt; are text strings representing what the respective names imply. Any field in the source table can be used as &lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt;. However, fields created through the as clause (&lt;SPAN class="Italic"&gt;aliasname&lt;/SPAN&gt;) are out of scope and cannot be used inside the same load statement.&lt;/P&gt;&lt;P class="note"&gt;&lt;SPAN class="Bold"&gt;Note!&lt;/SPAN&gt; &lt;BR /&gt;If no source of data is given by means of a from, inline, resident, from field or autogenerate clause, data will be loaded from the result of the immediately succeeding select or load statement. The succeeding statement should not have a prefix. &lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P&gt;Different file formats &lt;/P&gt;&lt;P class="Code"&gt;Load * from data1.csv; &lt;/P&gt;&lt;P class="Code"&gt;Load * from 'c:\userfiles\data1.csv' (ansi, txt, delimiter is ',', embedded labels); &lt;/P&gt;&lt;P class="Code"&gt;Load * from 'c:\userfiles\data2.txt' (ansi, txt, delimiter is '\t', embedded labels); &lt;/P&gt;&lt;P class="Code"&gt;Load * from file2.dif (ansi, dif, embedded labels); &lt;/P&gt;&lt;P class="Code"&gt;Load @1:2 as ID, @3:25 as Name, @57:80 as City from data4.fix (ansi, fix, no labels, header is 0, record is 80); &lt;/P&gt;&lt;P class="Code"&gt;Load * from C:\qdssamples\xyz.qvx (qvx); &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Selecting certain fields, calculating fields&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load FirstName, LastName, Number from data1.csv; &lt;/P&gt;&lt;P class="Code"&gt;Load @1as A, @2 as B from data3.txt' (ansi, txt, delimiter is '\t', no labels); &lt;/P&gt;&lt;P class="Code"&gt;Load FirstName&amp;amp;' '&amp;amp;LastName as Name from data1.csv; &lt;/P&gt;&lt;P class="Code"&gt;Load Quantity, Price, Quantity*Price as Value from data1.csv; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Selecting certain records&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load distinct FirstName, LastName, Number from data1.csv; &lt;/P&gt;&lt;P class="Code"&gt;Load * from Consumption.csv where Litres&amp;gt;0; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Loading data not on file&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load * Inline &lt;/P&gt;&lt;P class="Code"&gt;[CatID, Category &lt;/P&gt;&lt;P class="Code"&gt;0,Regular &lt;/P&gt;&lt;P class="Code"&gt;1,Occasional &lt;/P&gt;&lt;P class="Code"&gt;2,Permanent]; &lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;P class="Code"&gt;Load * Inline [UserID, Password, Access &lt;/P&gt;&lt;P class="Code"&gt;A, ABC456, User &lt;/P&gt;&lt;P class="Code"&gt;B, VIP789, Admin]; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;Load RecNo( ) as A, rand( ) as B autogenerate(10000);&lt;/SPAN&gt;(Note: The parenthesis after autogenerate is allowed but not required.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Loading data from previously loaded table&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;tab1: &lt;/P&gt;&lt;P class="Code"&gt;Select A,B,C,D from transtable; &lt;/P&gt;&lt;P class="Code"&gt;Load A,B,month(C),A*B+D as E resident tab1; &lt;/P&gt;&lt;P class="Code"&gt;Load A,A+B+C resident tab1 where A&amp;gt;B; &lt;/P&gt;&lt;P class="Code"&gt;Load A,B*C as E resident tab1 order by A; &lt;/P&gt;&lt;P class="Code"&gt;Load A,B*C as E resident tab1 order by 1,2; &lt;/P&gt;&lt;P class="Code"&gt;Load A,B*C as E resident tab1 order by C desc, B asc, 1 desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Loading data from previously loaded fields&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load A from_field (Characters, Types);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Loading data from succeeding table&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load A, B, if(C&amp;gt;0,'positive','negative') as X, weekday(D) as Y; &lt;/P&gt;&lt;P class="Code"&gt;Select A,B,C,D from Table1; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Grouping data&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;Load ArtNo, round(Sum(TransAmount),0.05) as ArtNoTotal from table.csv group by ArtNo; &lt;/P&gt;&lt;P class="Code"&gt;Load Week, ArtNo, round(Avg(TransAmount),0.05) as WeekArtNoAverages from table.csv group by Week, ArtNo; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Reading one record repeatedly&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="Code"&gt;My Tab: &lt;/P&gt;&lt;P class="Code"&gt;Load Student, &lt;/P&gt;&lt;P class="Code"&gt;mid(Grades,IterNo( ),1) as Grade, &lt;/P&gt;&lt;P class="Code"&gt;pick(IterNo( ), 'Math', 'English', 'Science', 'History') as Subject from Tab1.csv &lt;/P&gt;&lt;P class="Code"&gt;while mid(Grades,IterNo( ),1)&amp;lt;&amp;gt;' '; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 04:41:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889119#M1016023</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-04-10T04:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement the below query in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889120#M1016024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My Actual issues is I want to count IDs based on start and end date from the same table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID, start, end, country&lt;/P&gt;&lt;P&gt;1, 1/1/14, 2/1/14, AUS&lt;/P&gt;&lt;P&gt;2, 2/1/14, 2/1/14, US&lt;/P&gt;&lt;P&gt;3, 2/1/14, 3/1/14, AUS&lt;/P&gt;&lt;P&gt;4, 3/1/14, 3/1/14, US&lt;/P&gt;&lt;P&gt;5, 2/1/14, 4/1/14, AUS&lt;/P&gt;&lt;P&gt;If I select date 2/1/14&lt;/P&gt;&lt;P&gt;I want to see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Admissions&amp;nbsp;&amp;nbsp;&amp;nbsp; Separations&lt;/P&gt;&lt;P&gt;2/1/14&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(ID)= 3&amp;nbsp; Count(ID) = 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR&lt;/P&gt;&lt;P&gt;Country &amp;amp; Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Admissions&amp;nbsp;&amp;nbsp;&amp;nbsp; Separtions&lt;/P&gt;&lt;P&gt;AUS &amp;amp; 2/1/14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(ID)= 2&amp;nbsp; Count(ID) =1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or some other filters like country , city and all&lt;/P&gt;&lt;P&gt;based on the series of selection I want to change the admissions and Separations count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik Daibala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 06:36:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889120#M1016024</guid>
      <dc:creator />
      <dc:date>2015-04-10T06:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement the below query in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889121#M1016025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your data source ? If it in Database, you can execute the statement in QlikView Script directly to load data from the database using the SQL keyword before the statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 22:52:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-implement-the-below-query-in-Qlikview/m-p/889121#M1016025</guid>
      <dc:creator>shivanandk</dc:creator>
      <dc:date>2015-07-14T22:52:46Z</dc:date>
    </item>
  </channel>
</rss>

