Qlik Community

Qlik Sense Enterprise Documents & Videos

Documents & videos about Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT

Qlik Sense Partial Reload for v2.0.x, v2.1.1, v3.x

Employee
Employee

Qlik Sense Partial Reload for v2.0.x, v2.1.1, v3.x

28-Sep-2016: updated to work with Sense 3.1

The Engine API of Qlik Sense 2.0+ supports partial reload. However, there is - as of 2.0.1 - nowhere a button or option in the QMC or Script Editor to do so.

Note

Windows Security Warning
When you open the downloaded .zip, some Windows versions (eg 10) will show a warning of potential insecure content. This is due to an unsigned executeables found in the .zip. Please ignore this warning.

Thomas Friebel  >> wrote the attached qsreload.exe using Qlik Sense SDK, which invokes the necessary API calls. It runs from a Command Line Prompt with the rights of the Windows User, that opened the cmd.exe - Thank you, Thomas!

Video
Here is a Youtube Video to see this work >> Qlik Sense 2.0 Partial Reload - YouTube

ut all the attached files from the .zip into one folder on your harddisk. Then open a CMD.EXE and go to that folder.

Usage:

qsreload.exe -a="App Title"

Parameters

  • -a="App Title" ... required parameter
  • -p ... to use Partial Reload, if omitted then Standard Reload is used
  • -u="serverurl" ... url of the Sense server (localhost is assumed if omitted), e.g -u="ws://SERVER" or -u="http://SERVER:4747"

Should look like this

Clipboard01.jpg


The API calls in .CS are below, for those interested:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using Qlik.Engine;

namespace qsreload

{

    class Program

    {

        static void Main(string[] args)

        {

            string app = "";

            string url = "ws://localhost";

            bool partial = false;

            foreach(string arg in args) {

                Console.WriteLine(arg);

                if (arg.StartsWith("-a=")) {

                    app = arg.Substring(3);

                }

                if (arg == "-p")

                {

                    partial = true;

                }

                if (arg.StartsWith("-u="))

                {

                    url = arg.Substring(3);

                }

            }

            ILocation location;

            try {

            location = Qlik.Engine.Location.FromUri(new Uri(url));

            location.AsNtlmUserViaProxy(proxyUsesSsl: false);

            IEnumerable<IAppIdentifier> apps = location.GetAppIdentifiers();

            bool found = false;

            foreach (var salmon in apps)

            {

                if (salmon.AppName == app)

                {

                    Console.WriteLine("Performing " + (partial ? "PARTIAL " : "")+"reload of "+salmon.AppName + " ");

                    IApp foundApp = location.Hub().OpenApp(salmon.AppId);

                    bool ging = foundApp.DoReload(0, partial);

                    Console.WriteLine("Success: " + ging);

                    foundApp.DoSave();

                    found = true;

                }

            }

            if (!found)

            {

                Console.WriteLine("App " + app + " could not be found");

            }

            }

            catch (Exception ex)

            {

                Console.WriteLine("Connection to Qlik Sense Proxy at " + url + " failed");

                Console.WriteLine(ex.GetBaseException());

            }

        }

    }

}

---

Attachments
Comments
Partner
Partner

Capture.PNG

Good job Christof!!! its seems to be very useful!!!

I am trying, but have this error, what could be?

thank you a lot

Fernando

0 Likes
Employee
Employee

For some reason the .Exe cannot connect to the server on localhost. Are you running the .Exe on the machine where the Hub is? otherwise you need the -u="" parameter. If not localhost, is the connection listed in the Origin Whitelist of the Default Virtual Proxy?

0 Likes
Partner
Partner

Hi Christof!

Great contribution! I was looking for something like this.

I'm testing this with Sense 2.1.1, but have same error as Fernando. Any idea? Works this exe with this Qlik Sense Version?

Thanks.

0 Likes
Partner
Partner

Hi Christof

Great job !

could you provide us with a 2.1.1 compatible version ?

Thanks

0 Likes
Partner
Partner

Hi,

Nice tool !!!, But It can't connect to the 2.1.1 server. Why?

0 Likes
Not applicable

Using 2.1.1

Any idea what could be happening here? I'm running qsreload in a command file and in between runs am changing the number of records in one table. The relevant section of my load script is:

REPLACE

LOAD articleCode

  ,1 AS KPI;

SQL SELECT articleCode

FROM dbo.ArticleCollectionLink;

Is there any logging which might help explain why the first run succeeds and subsequent ones fail?

Capture.JPG

0 Likes
Not applicable

Hi All,

Great Job,

Is it possible to run the published App using the above method?

Example:

Stream Name : MYStream

APP: MYApp

how to execute the MYApp.

Thanks

Rajez..

0 Likes
Not applicable

Hi,

The solution seems not work well with qlik sense desktop.

Do you have a solution for it ?

Cheers,

Gaetan

0 Likes
Not applicable

Hi Schwarz,

We have a requirement to do partial reload in sense. I have done the same thing as shown in the video, but I can't able to see CMD shortcut file in the folder which I downloaded. Can u please tell me the detailed procedure to do partial reload in sense.

Note: I need to do it in desktop as well as cloud (different applications).

Please help me out.

Thanks in Advance.

Regards,

Arjun.

0 Likes
alexanderdev
New Contributor

Hi Christof,


Very useful thing, but in Qlik Sense 3.0.0 it's doesn't work. We tried to replace dll's but this doesn't help. Can you help with to fit for version 3.0.0?

Version history
Revision #:
1 of 1
Last update:
‎2015-06-30 11:29 AM
Updated by: