Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Engine API select range in .NET application

Hi All,

I apologise if this sounds like a stupid question but how do I use the Qlik Engine API in a .NET application? The reason I ask is because I want to select based on a range instead of an absolute value. E.g. select all transactions where, 500 <= amount <= 10,000, or where name like "sm%".

In order to try this out I created .NET WPF app where I display a Qlik Sheet using a <WebBrowser> control and that works fine. I honestly have no idea what to do next, I looked at the examples and got nowhere fast. I'm using the Helpdesk Management app as my test app. I'm also using the sheet Performance to do my select range testing. Hopefully the pic below will better explain what I'm trying to do. Basically I wan't to use Qlik Engine to filter selections where the Open Cases value is > 20 but < 80.

2016-06-07 14_06_15-Qlik Sense.png

Regards,

Alex

16 Replies
konrad_mattheis
Luminary Alumni
Luminary Alumni

Hi,

under the link I get only that page, if I try to download the DEMO.

bye Konrad

Øystein_Kolsrud
Employee
Employee

What link is it that you are having a problem with?

konrad_mattheis
Luminary Alumni
Luminary Alumni

Go here and click on the marked position.

Download code samples ‒ Qlik Sense

Not applicable
Author

Hi Guys,

I have looked at the documentation and after a while it took me some time to figure out part of it, just enough to display a sheet and make a selection, then be able to also clear all selections. I don't have the years experience in Qlik, so I found the concepts a little difficult to grasp and for the most part, just skipped them. I still don't understand the majority of it.

My intention for looking at the qlik engine was because I was directed their by a person who thought it would do what I was asking. What I really wanted to do was make a selection based on a condition and get values based on a condition, and I thought I could do that using the Qlik Engine. See below for an example:

App Id: Helpdesk Management

Field/Dimension: Case Owner

Values:

2016-06-16 09_52_53-Qlik Sense Desktop.png

For the field/dimension Case Owner in app Helpdesk Management, I would like to be able to select all values of Case Owner which start with A or alternatively, be able to get all values of Case Owner which start with A.

1. Select all Case Owner values that start with A:

So if I selected all values of Case Owner that start with A I would get the following screen for the Dashboard sheet:

2016-06-16 09_57_13-Inbox _ Qlik Community.png

2. Get all Case Owner values that start with A:

I would then also like the ability to get all values which start with A. So:

  • Aileen C. Millimaki
  • Aaracelis K. Ranum
Øystein_Kolsrud
Employee
Employee

That link seems to be working fine for me at least. It should trigger a download session for the vsix file. Could there be some setting in your browser that somehow blocks that type of operations? I've tried it in IE, Firefox and Chrome, and it works fine in all three of them.

Øystein_Kolsrud
Employee
Employee

The general selection and data retrieval mechanism of Qlik Sense is based on the concepts of hypercubes‌ and list objects‌. You might want to read a little about those to get an understand for how they work. However, for the case where you want to select all case owners based on a pattern matching on the values of the field, you probably want to use selection methods found in the class Field‌. Then once you have performed the selection, you can use the class IExtendedCurrentSelection to retrieve a list of the values that were selected.

The code for your example would look something like this (where "theApp" is the "Helpdesk Management" app in your example):

var fieldOfInterest = "Case Owner";


// Select the relevant values of the field

var theField = theApp.GetField(fieldOfInterest);

theField.Select("A*");


// Get the set of field values that were selected

var currentSelection = theApp.GetExtendedCurrentSelection();

var largePage = new NxPage { Top = 0, Left = 0, Width = 10, Height = 100 };

var pages = currentSelection.GetSelectedData(fieldOfInterest, new [] { largePage });

var selectedValues = pages.SelectMany(p => p.Matrix.Select(r => r[0].Text));

Not applicable
Author

I was able to use your example to do what I wanted to do. I also tried to use a List instead and think I got it working, so yay!