Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
HarshPrajapati
Contributor II
Contributor II

Getting Data with selectValues()

Hello guys , I am facing one issue. I am getting data with below expression 

app.field('title').selectValues(selectedValues, true, true)

But while data with the selectedValues is not found it returns whole data about that field. Is there any way to prevent this??

Also I have one question , Is there any method in Qlik that provides data checking like for example, data with a selected combination of data fields and filter is available or not like they did here :- https://bivisual.cpa.texas.gov/CPA/opendocnotoolbar.htm?document=documents%5CTR_Master_UI.qvw

here they are showing disable like checkbox is data is not available about that filter and I want to do something like that.

Qlik Sense Business Qlik GeoAnalytics 
Labels (4)
1 Solution

Accepted Solutions
alex_colombo
Employee
Employee

If you want to know which fields have been selected by users, you have to use selectionState method.
Instead, for reading all the data with the information if a value is selected, optional, excluced, etc.. from a field, you have to create a ListBox for each selected fields. You can follow these steps for creating it.
With this information, you know which data are selected, which data are exceluded, then you can disable data for your checkboxes

View solution in original post

8 Replies
alex_colombo
Employee
Employee

Hi @HarshPrajapati , why are you using selectValues method for getting data from a field? Could you please explain what is your goal? selectValues method is useful for select values in a field.
About second question, I think you have to monitor current selections and understand which values are selected, am I right?

HarshPrajapati
Contributor II
Contributor II
Author

I am trying to build a website like I mentioned in my question, so I need fields that user selects, but there is one issue when we use selecteValue with the data we want, it returns specific data if available else it sends the whole data of the column. I need to disable the checkboxes if data is unavailable like they did on a website.

https://bivisual.cpa.texas.gov/CPA/opendocnotoolbar.htm?document=documents%5CTR_Master_UI.qvw

alex_colombo
Employee
Employee

If you want to know which fields have been selected by users, you have to use selectionState method.
Instead, for reading all the data with the information if a value is selected, optional, excluced, etc.. from a field, you have to create a ListBox for each selected fields. You can follow these steps for creating it.
With this information, you know which data are selected, which data are exceluded, then you can disable data for your checkboxes

HarshPrajapati
Contributor II
Contributor II
Author

Am doing the same, I am checking which field is selected by a user and after that according to those values am building a chart. My main concern is if I have 3-4 types of filters like year, company, country, and salary. I have selected the year 2017, suppose there are some country there is not any data. so is there any way from that I can check if a user selects a value in one filter, there is any value available on the data? if yes then it should be selectable and if not then I want to disable them.

alex_colombo
Employee
Employee

As I mentioned, when you create a ListObject on a specific field, you can read all the data, and for each value you can understand if this value is available, excluded, optional, selected and so on. With this you can disable them based on your requirements. Please try to create a ListObject and when you get the data, you have qState parameter that indicated you the current state (selected, excluded, optional, etc)

HarshPrajapati
Contributor II
Contributor II
Author

Okay , Thank you just one last question, Am getting qState as 'O' and 'X' what does it means?? 

alex_colombo
Employee
Employee

Have a look here, there are descriptions for all possible values for qState.

HarshPrajapati
Contributor II
Contributor II
Author

Ok thank you.