<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stefan Enberg on Medium]]></title>
        <description><![CDATA[Stories by Stefan Enberg on Medium]]></description>
        <link>https://medium.com/@Stefan_Enberg?source=rss-c69f0e6a1171------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KgEX7uWbafu-X6fkvxQRkg.jpeg</url>
            <title>Stories by Stefan Enberg on Medium</title>
            <link>https://medium.com/@Stefan_Enberg?source=rss-c69f0e6a1171------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:07:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Stefan_Enberg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[JDBC Connector for Qlik Core]]></title>
            <link>https://medium.com/qlik-branch/jdbc-connector-for-qlik-core-46f13b60d2fb?source=rss-c69f0e6a1171------2</link>
            <guid isPermaLink="false">https://medium.com/p/46f13b60d2fb</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[qlik-sense]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Stefan Enberg]]></dc:creator>
            <pubDate>Fri, 10 Aug 2018 14:24:37 GMT</pubDate>
            <atom:updated>2018-08-10T14:24:37.078Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the first things that a Qlik Core user will stumble upon when building an application is how to connect to their data sources. This task is rather simple if the data is stored in flat files like CSV.</p><p>The data files are either mounted to the container or made accessible by a http request. A good tutorial that shows this can be found at <a href="https://www.qlikcore.com/tutorials/hello-data/">https://www.qlikcore.com/tutorials/hello-data/ </a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rKJ1iWgGHaHdyJDlPTEv7g.jpeg" /><figcaption>Visit <a href="https://www.qlikcore.com/tutorials/hello-data/">https://www.qlikcore.com/tutorials/hello-data/</a></figcaption></figure><p>What options are available if the data is instead stored in a database? The containerized Qlik Associative Engine uses a new gRPC protocol to communicate with connectors. gRPC is Google’s Remote Procedure Call protocol that uses Protocol Buffers to define data structures and uses HTTP 2.0 for communication.</p><p>One of the most powerful features of gRPC is that it is language agnostic and can generate interfaces from the protocol buffer files to a wide range of different programming languages. This feature gives connector developers the flexibility that we haven’t had before with Qlik Sense, where they needed to use a C# SDK.</p><p>We have a few example connectors available at the Qlik Core website to learn how a connector can be built, <a href="https://www.qlikcore.com/services/qix-engine/apis/data-loading/introduction/">https://www.qlikcore.com/services/qix-engine/apis/data-loading/introduction/</a>.</p><p>The latest addition to the connector examples is the JDBC connector, <a href="https://github.com/qlik-oss/core-grpc-jdbc-connector">https://github.com/qlik-oss/core-grpc-jdbc-connector</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jnGxdZAHy-HU7tf6bZjNxw.jpeg" /><figcaption><a href="https://github.com/qlik-oss/core-grpc-jdbc-connector">https://github.com/qlik-oss/core-grpc-jdbc-connector</a></figcaption></figure><p>We will in this article dig into some of the basics of the APIs and show how the connector works and how it can be extended with additional JDBC drivers.</p><h4>Connector Basics</h4><p>The obvious choice of language to implement the JDBC connector is of course Java (the J in the names stands for Java). We selected Maven to handle the dependencies and they are all listed the <em>pom.xml</em>. One of the build steps include translating the grpc_server.proto file into interfaces in java classes: qlik.connector.ConnectorpGRPC and qlik.connector.GrpcServer.</p><p>They include all the data structures used and base classes with function stubs that need to be implemented by extending them. The main bulk of the connector logic is located in the qlik.jdbc.connector.ConnectorImpl.java file.</p><p>The connector is responsible for implementing the <strong>getData </strong>method and it takes two parameters: the connection string and the load statement.</p><p>The connection string is the settings needed to connect to a specific data source, represented as <strong>qConnectionString </strong>in the method calls to Qlik Associative Engine. Here is an example of the settings that is needed in order to create a new connection with app.createConnection API call.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b554e56996237c41dbed6ed90c05997/href">https://medium.com/media/8b554e56996237c41dbed6ed90c05997/href</a></iframe><p><strong>qType </strong>represents what type of connector the connection should use.</p><p><strong>qName </strong>is the name of this connection instance.</p><p><strong>qConnectionString </strong>is the parameter that is sent to the connector. The parts of the connection string that is specific to the JDBC connector is the driver setting. It will be the JDBC driver that the connector will use to connect to the database with. The provider needs to be the same as the <strong>qType</strong>. Host, port and database are related to locating the database.</p><p><strong>qUserName </strong>and <strong>qPassword </strong>are the credentials used to access the database with (will be removed from the logs).</p><p>The second parameter to the getData method is the load statement. This is how a typical loadscript could look like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/199f03300730b3d184bc0cc0f50b58db/href">https://medium.com/media/199f03300730b3d184bc0cc0f50b58db/href</a></iframe><p>The “lib connect to ‘jdbc’;” refers to the name of the connection to use. “airports:” will be the internal name of the table loaded.</p><p>The actual load statement that is sent to the connector is everything after sql. In this case the load statement will be “SELECT * FROM airports”.</p><h4>Data Chunking</h4><p>When getData is called during a reload from QIX Engine the first thing the connector will do is to call the JDBC Driver Manager and try to establish a connection to the database.</p><p>If the connection is successful, a query with the content of the load statement. The result of that query is used in two ways. The first thing is that the metadata information about the query like table name, columns, datatypes and so on will be extracted and added to the response header sent back to QIX Engine.</p><p>The actual data retrieved from the query will be added into Data Chunks. A Data Chunk consists of a stringBucket, a doubleBucket, a stringCodes and a numberCode.</p><p>The stringBucket is an array of strings and the stringCodes is an index array referencing values in the stringBucket.</p><p>The doubleBucket is an array of doubles and the numberCodes is an index array referencing values in the doubleBucket.</p><p>More on the response data structure can be found at <a href="https://www.qlikcore.com/services/qix-engine/apis/data-loading/data-connector-api/">https://www.qlikcore.com/services/qix-engine/apis/data-loading/data-connector-api/</a></p><p>The connector will add the queried data according to data type to the appropriate bucket and indexes to a Data Chunk. The Data Chunk will be streamed back to QIX engine when a suitable size is reached. This should be below the max limit of 4MB that gRPC has but not too small to become overly chatty. The JDBC connector has an environment setting that is used to limit the number of rows in each Data Chunks and that is <strong>MAX_DATA_CHUNK_SIZE</strong>.</p><p>Another setting that can impact the performance hugely is the <strong>DATABASE_FETCH_SIZE</strong>. This environment variable is used to define the batch size of the number of rows fetched from the database to the connector, this is to avoid depleting all the memory within the connector container.</p><h4>How to add new JDBC drivers</h4><p>Adding additional JDBC drivers can be done in a few ways. If the driver exists as a Maven artifact in its repository then it is just a matter of adding that dependency to the pom.xml file. It could look something like this:</p><pre>&lt;dependencies&gt;<br>  &lt;dependency&gt;<br>    &lt;groupId&gt;org.postgresql&lt;/groupId&gt; <br>    &lt;artifactId&gt;postgresql&lt;/artifactId&gt;<br>    &lt;version&gt;42.2.2&lt;/version&gt;<br>  &lt;/dependency&gt;<br>&lt;/dependencies&gt;</pre><p>If the JDBC driver is not in the Maven repository then another approach would be to add the folder that holds the JDBC driver jar file to the src folder in the connector project. Then add that dependency with a systemPath to the pom.xml file. Could look something like this</p><pre>&lt;dependencies&gt;<br>  &lt;dependency&gt;<br>    &lt;groupId&gt;com.special.jdbc.drivers&lt;/groupId&gt;<br>    &lt;artifactId&gt;jdbc-drivers&lt;/artifactId&gt;<br>    &lt;version&gt;1.0&lt;/version&gt;<br>    &lt;scope&gt;system&lt;/scope&gt;  <br>    &lt;systemPath&gt;${basedir}/src/yourJar.jar&lt;/systemPath&gt;<br>  &lt;/dependency&gt;<br>&lt;/dependencies&gt;</pre><h4>Summary</h4><p>The JDBC example connector will open lots of new opportunities to connect to generic databases without having to build a customized connector from scratch. It is easy to add new JDBC drivers by adding them as dependencies to pom.xml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*AtwFQFw4x-j6yvnjPsiAzA.jpeg" /><figcaption>For more information, visit <a href="https://www.qlikcore.com/">https://www.qlikcore.com/</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46f13b60d2fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qlik-branch/jdbc-connector-for-qlik-core-46f13b60d2fb">JDBC Connector for Qlik Core</a> was originally published in <a href="https://medium.com/qlik-branch">Qlik Branch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IoT analytics with Qlik Sense]]></title>
            <link>https://medium.com/qlik-branch/iot-analytics-with-qlik-sense-bed9e89fa29c?source=rss-c69f0e6a1171------2</link>
            <guid isPermaLink="false">https://medium.com/p/bed9e89fa29c</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[esp8266]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Stefan Enberg]]></dc:creator>
            <pubDate>Fri, 28 Jul 2017 13:35:39 GMT</pubDate>
            <atom:updated>2017-07-28T13:35:39.943Z</atom:updated>
            <content:encoded><![CDATA[<h3>Where it all started</h3><p>I have always been fascinated with electronics, but never actually gotten around to building any circuits myself until recently. It all started with me being annoyed that our porch lights at home were either turned on all day or not at all during the night. Needless to say, they were manually controlled by a light switch. To solve this, I bought a bunch of Nexa remote controlled switches and a Tellstick Net that supports light scheduling. This worked really well for our outdoor lights, but not perfect for the indoor lighting. During weekends, the lights are programmed to turn on around 07:00 in the morning and off at sunrise +3 hours. This works fine on sunny days. But when it is cloudy, it gets too dark and they should ideally stay on longer.</p><p>I also bought a temperature and humidity sensor that integrated nicely with the Tellstick. Now it was possible to see the current temperature and humidity but not any historical readings from yesterday since the data weren’t persisted.</p><p>I looked for a off-the-shelf solution that could solve both these problems, but could find a good one. This was the perfect opportunity to learn more about electronics.</p><h3>Device Hardware</h3><p>I looked for a solution that required few parts that were easy to program and had good connectivity. I found the ESP8266 WiFi chip and it turned out to be a really good match. It is a small and cheap MCU with WiFi capabilities and some available GPIO ports and is programmable through the Arduino IDE.</p><p>The hardware setup for my staple device are composed of a ESP8266 ESP-12 board with a AM2320 temperature/humidity sensor attached. The device is powered by LiPo battery pack that is protected by a TP4056 charger circuit and regulated by a HT7333 LDO. The battery voltage is measured with the ADO available on the ESP8266.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHGQ2pqC64jhwWka1FK22Q.jpeg" /></figure><h3>Device Software</h3><p>The software is written in C++ in the Arduino IDE heavily using open-sourced libraries for sensor reading and communication.</p><p>To preserve battery power the devices are kept sleeping for most of the time and awaken every 10th minute to sample and transmit data. The data is transmitted to <a href="https://thingspeak.com/">thingspeak.com</a> for storage.</p><h3>Analyzing the data</h3><p>The data uploaded to <a href="https://thingspeak.com/">thingspeak.com</a> is accessible with a get HTTP-request. I found a few apps that could visualize the data on a chart but I wanted to be able to display multiple sensor in the same chart. Ideally something that would allow me to analyse the data in greater depths.</p><p>Since I work for Qlik, a company that makes awesome analytics software, the choice of tool was really easy.</p><p>My Qlik Sense application is accessible on <a href="https://tinyurl.com/y8wv69pg">https://tinyurl.com/y8wv69pg</a></p><p>In Sense, I have a app containing a few dashboards displaying my collected sensor data. It is possible to use the associative power of Qlik Sense to gain insights about my home.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2I6vITU8kyyZsncv9u8zw.png" /><figcaption>Bathroom temperature/humidity sensor</figcaption></figure><p>For instance, when the humidity spikes in the bathroom, that is a indication that someone took a shower. If the time range when the humidity is high is selected, I can then navigate to the electricity consumption dashboard. Here it is possible to see how much electricity is needed to heat the water in the boiler. From that insight, I can then compare it with the average electricity consumption and calculate how much electricity is needed for one shower.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EObB6d8lMgmSw4JmT6yckg.png" /><figcaption>Electricity consumption sensor</figcaption></figure><h3>Conclusion</h3><p>I have a pretty solid setup where I easily can build more devices and have their data available in my Qlik Sense application to analyze. Some devices that are in the build pipeline are:</p><ul><li>Motion sensors</li><li>Boiler temperature sensors</li><li>Air quality sensors</li><li>Rain sensor</li><li>Water table distance sensor</li></ul><p>The thing that is missing to solve my original problem is to build a service that uses the data collected from my light sensor and integrate it with the Tellstick API. I’m not sure when that will happen, but one thing is for sure and that is that more sensors will be built and more data will be collected. All gathered data will need to be analyzed to make any Sense of it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bed9e89fa29c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qlik-branch/iot-analytics-with-qlik-sense-bed9e89fa29c">IoT analytics with Qlik Sense</a> was originally published in <a href="https://medium.com/qlik-branch">Qlik Branch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[halyard.js]]></title>
            <link>https://medium.com/qlik-branch/halyard-js-553b41df3b24?source=rss-c69f0e6a1171------2</link>
            <guid isPermaLink="false">https://medium.com/p/553b41df3b24</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Stefan Enberg]]></dc:creator>
            <pubDate>Fri, 26 May 2017 14:37:37 GMT</pubDate>
            <atom:updated>2017-05-26T14:39:35.050Z</atom:updated>
            <content:encoded><![CDATA[<h4>a new data loading experience</h4><p>One of the biggest hurdles our users experience on their journey to business insights is how to load data into <strong><em>Qlik Sense</em></strong>. We have put a lot of effort into improving the data loading experience for non technical users with great features like: drag-n-drop files, associations recommendations and bubbles. But what about technically skilled users that wants to consume our APIs without learning how to write <strong><em>Qlik Script</em></strong>?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RTdJaOCpBvzegkx_BHAXlg.png" /></figure><p>Introducing <a href="https://github.com/qlik-oss/halyard.js"><strong><em>halyard.js</em></strong></a> to the world, a brand new library designed exclusively for our API consumers. <em>halyard.js</em> is released open source and written in ES6 and works both in browsers and in Node.js. The library is split into two pieces to make it more flexible and extendable. One part that generate script and connection artifacts and a second that takes those artifacts and feeds them to the QIX-engine through <a href="https://github.com/qlik-trial/enigma.js"><em>enigma.js</em></a>.</p><p>One of the most powerful features in <em>halyard.js</em> is the capability to inline load data without using a connector. This enables the user to load their raw data to a <em>halyard.js</em> table before the actual reload. This gives the users the power to choose any tool to access their data without having to depend on various custom connectors. One example could be protected web data resources that currently aren’t accessible with the webfile-connector.</p><p>Here is a quick teaser of how easy data loading with <em>halyard.js can be</em>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d1bc5ffd6b02ef6f789d5595f7cb0f1/href">https://medium.com/media/2d1bc5ffd6b02ef6f789d5595f7cb0f1/href</a></iframe><p>I won’t go into more technical details right now but <em>halyard.js</em> includes many more features like: field transformations, data/time formatting, calendar templates and much more.</p><p>If you are interested and want to learn more please visit <a href="https://github.com/qlik-oss/halyard.js"><em>halyard.js</em></a> on <a href="https://github.com/">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=553b41df3b24" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qlik-branch/halyard-js-553b41df3b24">halyard.js</a> was originally published in <a href="https://medium.com/qlik-branch">Qlik Branch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>