Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

.NET SDK Select field item(s) by ElemNumber

Hi all,

using the .NET SDK, I can make a selection on a field using code such as this (where 'app' is an IApp instance):

app.GetField("Country")

   .Select("Sweden");

This is nice, but I'd like to be able to do the equivalent using the element number.  Is there an easy way to do this? 

At the moment, I'm getting all the possible values for the field into a listbox (from a 'CreateListbox' call) and selecting the values using the list box's 'SelectValues' call', which doesn't seem that efficient or elegant.

Any help would be appreciated.

Thanks a lot,

Shane.

1 Solution

Accepted Solutions
Not applicable

Re: .NET SDK Select field item(s) by ElemNumber

Hi,

sorry should have done my home work

Selection on cells can be done on hyper cubes, If you create a session object with an hypercube you will be able to do selections on cells (myGenericObject.SelectHyperCells...)

Best Regards

Lars-Göran Book

4 Replies
Not applicable

Re: .NET SDK Select field item(s) by ElemNumber

Hi,

There is a AppField class that is the Field in a ListObjectDef, this is probably what you are looking for.

Best regards

Lars-Göran Book

Not applicable

Re: .NET SDK Select field item(s) by ElemNumber

Hi,

thanks for getting back to me.  I'm not sure I follow 100% - are you saying I can use something like this:

IAppField af = app.GetAppField("FieldName");

af.SelectListObjectValues("/qListObjectDef", new[] { 1187 }, false);

^- where 1187 is a valid elemNumber?

Thanks,

Shane.

Not applicable

Re: .NET SDK Select field item(s) by ElemNumber

Hi,

sorry should have done my home work

Selection on cells can be done on hyper cubes, If you create a session object with an hypercube you will be able to do selections on cells (myGenericObject.SelectHyperCells...)

Best Regards

Lars-Göran Book

Not applicable

Re: .NET SDK Select field item(s) by ElemNumber

thanks - I'll look into it