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: 
Not applicable

How to set a default value in a list

Hi,

I am new in QlikView, so sorry if this is a silly question and sorry for my poor English too.

Let me explain the situation

I have a chart showing the schools (y axis) and the number of students (x-axis) and a list to filter schools.

What I need is the chart always showing a default school.

And when I select another school on the list this second school should appear along with the other to compare both.

If it is possible I also would like if the default school didn't appear in the list

Let me you if you need more details.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

I'm not sure I understand the requirement completely either, but throwing out something at random:

if(getselectedcount(School)
  ,only({<School+={'school1'}>} NumberofStudent)
  ,only({<School ={'school1'}>} NumberofStudent))

Edit: and to hide the default School on the list, use an expression for the list box, maybe something like =if(School<>'school1',School)

View solution in original post

9 Replies
sunny_talwar

Try it using this set analysis:

{<$+<School = {'School1'}>}

So if this was your expression -> Sum(Revenue), you will need to change it to -> Sum({<$+<School = {'School1'}>}Revenue)

Not applicable
Author

I already tried set analysis.

I don't need sum so tried only({$<School={'school1'}>}[NumberofStudent])

and this work but when I click in other school on the list there are no chage in the chart it keeps showing only the default school

sunny_talwar

Add a + between $ and <

Only({$+<School={'school1'}>}[NumberofStudent])

Not applicable
Author

it helped at first it shows all the schools but when I select other schol on the list it shows just the selected school and the default school. And to hide the default school on the list one simple if was enough.

Thank you.

If know a way to show just the default school at first let me know.

sunny_talwar

I thought that was the requirement that you wanted to add by selection other schools?

Not applicable
Author

Yes I want to add by selection, But when any school is selected it is showing all the schools and if it is possible I would like to show just the default school when any other school is selected.

johnw
Champion III
Champion III

I'm not sure I understand the requirement completely either, but throwing out something at random:

if(getselectedcount(School)
  ,only({<School+={'school1'}>} NumberofStudent)
  ,only({<School ={'school1'}>} NumberofStudent))

Edit: and to hide the default School on the list, use an expression for the list box, maybe something like =if(School<>'school1',School)

Not applicable
Author

Thank you. worked

sunny_talwar

Please close this thread by marking John's answer as correct answer.

Qlik Community Tip: Marking Replies as Correct or Helpful