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

How to get Field using .net sdk

Hi All,

    Am new to qlik sense using .net sdk , i want get field Num(value) based on field name in c#. How to achieve this , please help me

Thanks

Prasanna A

1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

There's a GetData method that takes a page set as well:

https://help.qlik.com/en-US/sense-developer/February2018/apis/net+sdk/html/M_Qlik_Engine_DataPager_G...

There's an example on how to use it available here:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage/blob/master/HypercubeUsage/Program.cs#L2...

So if you only want the first two entries you would do something like this:

var page = new [] {new NxPage { Height = 2}};

var data = appField.ListObjectPager.GetData(page);

View solution in original post

4 Replies
Øystein_Kolsrud
Employee
Employee

Typically one would the the AppField class for that. Once you have an instance of that class you can either use it's GetData method or traverse it's data through the ListObjectPager property. I would have gone with the second option, in which case it would look something like this:

var appField = app.GetAppField("myfield");

var data = appField.ListObjectPager.GetData();

You can find more information about AppField class here:

https://help.qlik.com/en-US/sense-developer/February2018/Subsystems/NetSDKAPI/Content/WorkWith/Net-S...

And more information about how to work with the pager class can be found here:

https://help.qlik.com/en-US/sense-developer/February2018/Subsystems/NetSDKAPI/Content/HowTos/Net-Sdk...

Anonymous
Not applicable
Author

Thanks for Replay Oystein Kolsrud,

            In my case,

  1. var appField = app.GetAppField("Month");  // month my field name
  2. var data = appField.ListObjectPager.GetData();  // data will return 12 months

here am passing "Month" as field name , data will return 12 month like (Jan, Feb, Mar,.... Dec) , Its possible to pass specific months like (Jan,Feb) only 2 months instead of 12 months.

Thanks

Øystein_Kolsrud
Employee
Employee

There's a GetData method that takes a page set as well:

https://help.qlik.com/en-US/sense-developer/February2018/apis/net+sdk/html/M_Qlik_Engine_DataPager_G...

There's an example on how to use it available here:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage/blob/master/HypercubeUsage/Program.cs#L2...

So if you only want the first two entries you would do something like this:

var page = new [] {new NxPage { Height = 2}};

var data = appField.ListObjectPager.GetData(page);

Anonymous
Not applicable
Author

Thank you ... you saved my time lot.