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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Column Filter?

Hey Everyone!

I'm fairly new to qlikview.

I have a dataset of a class of students. This dataset consists of the grades they scored in different subjects from 0-100. Each subject's marks for every student is stored in an individual columns.


There are 10 subjects. Therefore each student (or row) will have 10 columns containing grades.

I want to create a single visualization (bar chart) with a separate object that i can use as a filter for the subjects. So if I wanted to, i could switch between subject 1, 2 or 10 for all students instead of creating a bar chart for each subject.

How should I go about doing this?

Thanks

2 Replies
Nicole-Smith

I would CrossTable your data.  Using CrossTable would take your data that looks like this:

Student Subject 1 Subject 2 Subject 3 Subject 4 Subject 5 Subject 6 Subject 7 Subject 8 Subject 9 Subject 10
Jane Smith100908070605040302010
John Smith0102030405060708090

And make it look like this:

Student Subject Score
Jane SmithSubject 1100
Jane SmithSubject 290
Jane SmithSubject 380
Jane SmithSubject 470
Jane SmithSubject 560
Jane SmithSubject 650
Jane SmithSubject 740
Jane SmithSubject 830
Jane SmithSubject 920
Jane SmithSubject 1010
John SmithSubject 10
John SmithSubject 210
John SmithSubject 320
John SmithSubject 430
John SmithSubject 540
John SmithSubject 650
John SmithSubject 760
John SmithSubject 870
John SmithSubject 980
John SmithSubject 1090

You could then use the "Subject" field for filtering.

The code to do this transformation looks like this:

Data:

CrossTable(Subject, Score, 1)

LOAD * INLINE [

    Student, Subject 1, Subject 2, Subject 3, Subject 4, Subject 5, Subject 6, Subject 7, Subject 8, Subject 9, Subject 10

    John Smith, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90

    Jane Smith, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10

];

If you have more fields than just name, you may need to change the 1 to a higher number.

Anonymous
Not applicable
Author

Thanks Nicole!

I appreciate the effort!

I found out on another thread here that I can add the subjects as expressions in the bar chart, and then use the group option in the expression tab to group the subjects together. This created a cyclic group button on my bar chart which allows me cycle between subjects on the same visualization.

I guess I should've searched more before asking this question!