Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
berndpodhradsky
Partner - Contributor III
Partner - Contributor III

.NET API Qlik Sense GetPossibleValues

Hi!

In QlikView there used to be methods such as "GetPossibleValues" and "GetAllValues" etc on a field. How can I achieve the same thing with Qlik Sense? I know that the IField interface carries methods to select possible values etc but I just want to get an array of values, not actually select them.

Any idea where to start?

Bernd

4 Replies
Øystein_Kolsrud
Employee
Employee

I think the typical way to do that would be to go through an AppField instance. It provides you with methods like AppField.GetExcluded‌ and AppField.GetOptional. I'm not sure about the the semantics of "GetPossibleValues" in QlikView, but I think GetOptional would be what you want (possibly combined with AppField.GetSelected‌.AppFields are constructed from the App through this method: AppExtensions.GetAppField

An example could look something like this:

var countryField = app.GetAppField("Country");

var page = new NxPage(){ Height=20, Width=1, Top=0, Left=0 };

var selectedCountries = countryField.GetSelected(page);

berndpodhradsky
Partner - Contributor III
Partner - Contributor III
Author

Thanks for pointing me in the right direction - now works perfectly fine, great!

berndpodhradsky
Partner - Contributor III
Partner - Contributor III
Author

Again, thanks for giving me that hint - could you please have a look at the following thread, where I have another question?

Total Cells via GetData

Thanks,

Bernd

Øystein_Kolsrud
Employee
Employee

Done! I just posted an answer on that thread.