Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Hide column based table value selection

Hi,

I have a requirement to show records from Mongo DB in a table view.

Each record in Mongo db collection "ResponseTable" represents a survey response as key value pair as below.

{ "survey_id" : "u0nni1bc1", "How likely are you to recommend 'Test App' to your friends, family and colleagues?" : "8" }

{ "survey_id" : "u0nni1bc1", "How likely are you to recommend 'Test App' to your friends, family and colleagues?" : "10" }

{ "survey_id" : "u0nni1bc1", "How likely are you to recommend 'Test App' to your friends, family and colleagues?" : "3", "Please tell us why" : "no easy to use" }

{ "survey_id" : "u0nni1bc2", "How likely are you to recommend 'Test App' to your friends, family and colleagues?" : "8", "Survey 2 question" : "Answer 2" }

{ "survey_id" : "u0nni1bc2", "How likely are you to recommend 'Test App' to your friends, family and colleagues?" : "10", "Survey 2 question" : "Answer 2" }

{ "survey_id" : "u0nni1bc2", "How likely are you to recommend 'Test App' to your friends, family and colleagues?" : "3", "Please tell us why" : "no easy to use", "Survey 2 question" : "Answer 2" }

"ResponseTable" can potentially have responses for different surveys.

I pulled all the records from db and created table view. which looks like attached file(tableview).

survey id "u0nni1bc2" have question called "Survey 2 question" which is not relevant to survey id "u0nni1bc1".

So when select survey id "u0nni1bc1" in table view i wanted to hide column named "Survey 2 question".

I tried  to achieve this using some expressions and no luck.

Can anybody help on this.

Thanks in advance.

6 Replies
giakoum
Honored Contributor II

Re: Hide column based table value selection

Do you have a column called Survey 1 Question?

I would better have it in a separate table then in a common column called Survey Question.

If that is not possible, then try the following function :

getfieldselections ( FieldName [, ValueSep [, MaxValues]])

Returns a string with the current selections in a field.

ValueSep is the separator to be put between field values. The default is ', '.

Maxvalues is the maximum number of field values to be individually listed. When a larger number of values is selected the format 'x of y values' will be used instead. The default is 6.

Not applicable

Re: Hide column based table value selection

Thanks for quick response loannis.

Approach1: having common column.

We store all survey responses to question in a single table.

It is possible that one survey called survey1 can have many number of question like "Survey 1 Question1" ,"Survey 1 Question2" which are not applicable for another survey called survey2.

There wont be any common questions between survey1 and survey2.

Approach2: getfieldselections ( FieldName [, ValueSep [, MaxValues]])

I played around getfieldselections  and it is to get the selected value in a table.


But what i am trying to achieve is on selection of particular survey called survey 2 , i want to hide columns "Survey1 Question1" and "Survey1 Question2".

Re: Hide column based table value selection

Try condition option for the dimension [Survey 2 question]

Use condition as below

=getPossibleCount([Survey 2 question])

Not applicable

Re: Hide column based table value selection

Thanks for your response adhimulam.

My qlikview app reloads data on daily basis to reflect new survey responses in to the app. so eventually we will be seeing new survey responses.

how do we add dynamic questions in (=getPossibleCount([Survey 2 question])).

we don't want to keep doing changes to qlikview app for new responses.

Re: Hide column based table value selection

Can you attach sample? So that I can have a look at your model and table view you are using.

Not applicable

Re: Hide column based table value selection

Attached sameple qvw

Community Browser