Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mamltdv
Contributor
Contributor

Search in Qlik Sense using the API

Hi all,

I am new to using the Qlik Sense API, and I am testing the Windows API, both the JSON RPC and the Javascript API. I would like to know which is the best for making queries against the model stored on the server and how it can be done.

Thanks in advance,
Miguel Angel

2 Replies
Øystein_Kolsrud
Employee
Employee

If you're new to the APIs, then I would recommend that you have a look at this site (and I apologize if you already knew this and I'm stating the obvious 🙂) :

https://help.qlik.com/en-US/sense-developer/April2020/Content/Sense_Helpsites/Developer-help-windows...

In particular, it is the Engine API that is of interest to you, and this page contains an overview of some of the fundamental concepts that you need to be aware of:

https://help.qlik.com/en-US/sense-developer/April2020/Subsystems/Platform/Content/Sense_PlatformOver...

The top three "Concepts" (GenericObject, Hypercube, ListObect) are the most important ones and are fundamental to understand if you want to extract data from Qlik Sense. Hypercube is the most important one of theses. That is the concept used by most visualizations for displaying aggregated data by defining a set of dimensions and measures to compute based on those dimensions.

An example of how to use hypercubes (in C#) for different kinds of data extraction can be found here:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage

mamltdv
Contributor
Contributor
Author

Hi Yko:
First of all, thanks for your reply.

I have been reading the links that you have indicated and also reviewing the Javascript API and at the end I have done tests using the following code:

      this.app.field('field1').clear();
      var field1= this.app.field('field1');
      field1.selectMatch('value1',true);	 

       var table = this.app.createTable(["state"], ["Sum(people)"],{rows:200});	

	 var listener = function() {
		var rowCount = table.rowCount;
		var colCount = table.colCount;
		table.OnData.unbind( listener );  //unregister the listener when no longer notification is needed.
	 };
	 table.OnData.bind( listener ) 

Is this a correct way to do it?

I have verified that when making filters in the fields of the dimension these changes are also reflected in the Qlik Sense Desktop application where I have some example graphics. Is it not possible to make filters with the API that do not make changes in the Desktop application?

Best regards,
Miguel Angel