<?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 Qlikview - create tables based on unique field values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694002#M593416</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I've been trawling the forums but not managed to work this one out, any help would be awesome thanks,&lt;/P&gt;&lt;P&gt;I've got a blob of raw data coming in from unique sensors col (A) at random time frequency col (B) that have a value reading col (C). I need to convert this data in script to produces individual tables for each sensor that includes; their unique sensor, individual timestamp and related value - this will let me work with them downstream in the data model.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Again, thanks for any help!&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:49:57 GMT</pubDate>
    <dc:creator>Patreson31</dc:creator>
    <dc:date>2024-11-16T00:49:57Z</dc:date>
    <item>
      <title>Qlikview - create tables based on unique field values</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694002#M593416</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I've been trawling the forums but not managed to work this one out, any help would be awesome thanks,&lt;/P&gt;&lt;P&gt;I've got a blob of raw data coming in from unique sensors col (A) at random time frequency col (B) that have a value reading col (C). I need to convert this data in script to produces individual tables for each sensor that includes; their unique sensor, individual timestamp and related value - this will let me work with them downstream in the data model.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Again, thanks for any help!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:49:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694002#M593416</guid>
      <dc:creator>Patreson31</dc:creator>
      <dc:date>2024-11-16T00:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - create tables based on unique field values</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694033#M593417</link>
      <description>&lt;P&gt;Hi, You can create a table and a qvd for each sensor using a bucle that reads the table for each value in sensors field, like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tmpSensor:
// LOAD Data
;

FOR vValueNum=1 to FieldValueCount(Sensor)
	LET vSensor = FieldValue('Sensor', $(vValueNum));
	
	$(vSensor):
	NoConcatenate LOAD * From Resident tmpSensor Where Sensor='$(vSensor)';
	
	STORE $(vSensor) into [Path\$(vSensor).qvd] (qvd);
	DROP Table $(vSensor);
NEXT

DROP Table tmpSensor;&lt;/LI-CODE&gt;&lt;P&gt;Then you can read from qvds which stores data of each Sensor.&lt;/P&gt;&lt;P&gt;If there is a lot of data loading time can be improved creating a qvd from initial data and doing an optimized load of that qvd using Exists().&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 11:33:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694033#M593417</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2020-04-16T11:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - create tables based on unique field values</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694079#M593418</link>
      <description>&lt;P&gt;Hi Rubenmarin,&lt;/P&gt;&lt;P&gt;Thanks for the response, I like the approach - individual qvd's would really work as more data comes in.&lt;/P&gt;&lt;P&gt;Sorry if I'm being a bit thick, I'm having a couple of problems with the script which I'm trying to work through but if you have any suggestions:&lt;/P&gt;&lt;P&gt;"""Semantic error&lt;/P&gt;&lt;P&gt;FOR vValueNum= 1 to FieldValueCount(Sensor)"""&lt;/P&gt;&lt;P&gt;"""Syntax error&lt;/P&gt;&lt;P&gt;Unexpected token: ')', expected one of: '(', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', 'bitnot', 'LITERAL_NUMBER', ...&lt;/P&gt;&lt;P&gt;LET vSensor = FieldValue('Sensor', &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;)&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;"""&lt;/P&gt;&lt;P&gt;"""Unknown statement: :&lt;BR /&gt;NoConcatenate LOAD * From tmpSensor Where Sensor=''&lt;/P&gt;&lt;P&gt;:&lt;BR /&gt;NoConcatenate LOAD * From tmpSensor Where Sensor="""&lt;/P&gt;&lt;P&gt;"""Syntax error&lt;/P&gt;&lt;P&gt;Unexpected token: '[Path\.qvd]', expected one of: ',', 'as', 'from', 'into'&lt;/P&gt;&lt;P&gt;STORE into &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;[Path\.qvd]&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; (qvd)"""&lt;/P&gt;&lt;P&gt;"""Semantic error&lt;/P&gt;&lt;P&gt;The control statement is not correctly matched with its corresponding start statement&lt;/P&gt;&lt;P&gt;NEXT"""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 13:23:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694079#M593418</guid>
      <dc:creator>Patreson31</dc:creator>
      <dc:date>2020-04-16T13:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - create tables based on unique field values</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694086#M593419</link>
      <description>&lt;P&gt;Ok, I didn't tested so it had a few syntax errors, this one doesn't gives any errors:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tmpSensor:
LOAD * Inline [
Sensor, Value
A, 3
B, 5
];

FOR vValueNum=1 to FieldValueCount('Sensor')
	LET vSensor = FieldValue('Sensor', $(vValueNum));
	
	[$(vSensor)]:
	NoConcatenate LOAD * Resident tmpSensor Where Sensor='$(vSensor)';
	
	STORE $(vSensor) into [.\$(vSensor).qvd] (qvd);
	DROP Table $(vSensor);
NEXT

DROP Table tmpSensor;&lt;/LI-CODE&gt;&lt;P&gt;You'll need to adapt tmpSensor to your original data and maybe change the .\ path in store to the one you want to store qvds.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 13:31:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694086#M593419</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2020-04-16T13:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - create tables based on unique field values</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694147#M593420</link>
      <description>&lt;P&gt;That's fantastic Rubenmarin. Sorry, there is one final niggle where I get an error:&lt;/P&gt;&lt;P&gt;"""Syntax error&lt;/P&gt;&lt;P&gt;Unexpected token: '*', expected one of: ':', 'IDENTIFIER', 'LITERAL_FIELD', 'LITERAL_STRING', 'IDENTIFIER', 'LITERAL_STRING', 'LITERAL_FIELD', ...&lt;/P&gt;&lt;P&gt;STORE &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;*&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; End Repeat..."""&lt;/P&gt;&lt;P&gt;after the loop has stored the first qvd in the directory. Gone down the rabbit hole reading about BNF settings but wonder if there is perhaps a simpler solution.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 15:37:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694147#M593420</guid>
      <dc:creator>Patreson31</dc:creator>
      <dc:date>2020-04-16T15:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - create tables based on unique field values</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694149#M593421</link>
      <description>&lt;P&gt;Maybe is beacuse the table has some starnge character, try enclosing all table names between []:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;STORE [$(vSensor)] into [.\$(vSensor).qvd] (qvd);
DROP Table [$(vSensor)];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the name of the sensor is just * it can't be saved as that name, please check that teher is no Sensor with that name.&lt;/P&gt;&lt;P&gt;Also you can use purgechar to avoid forbidden characters for file names:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LET vSensor = FieldValue('Sensor', $(vValueNum));
LET vSensorTableName = PurgeChar(FieldValue('Sensor', $(vValueNum)), '*/\:&amp;lt;&amp;gt;?="';&lt;/LI-CODE&gt;&lt;P&gt;And use&amp;nbsp;vSensorTableName instead of vSensor, just keep vSensor on the Where clause&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 15:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694149#M593421</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2020-04-16T15:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - create tables based on unique field values</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694161#M593422</link>
      <description>&lt;P&gt;Phenomenal - purgechar was just the trick. Thanks very much again!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 16:31:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-create-tables-based-on-unique-field-values/m-p/1694161#M593422</guid>
      <dc:creator>Patreson31</dc:creator>
      <dc:date>2020-04-16T16:31:15Z</dc:date>
    </item>
  </channel>
</rss>

