Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Column with only certain data

Everyone on here is always so helpful, so here is another question.... 

I am working on Student discipline events and I need a column that shows just the number of events per student for the last few years.  I have a column that will do a year when that year is highlighted but I want to create columns that no matter what year is highlighted it will show the number of incidents per a student for 2018 or 2017 or 2016.  I am trying to see if my chronic behavior students are consistent year after year of if student has started to misbehave the last year (maybe due to outside forces we can't control for in school)

This is what I use if I click on a given year.

=max(aggr(count(distinct behaviorDetail.incidentID),Student_Name))

Is there a place in there to slip in Year = 2018 or Year = 2017?

C

1 Solution

Accepted Solutions
Highlighted
Specialist II
Specialist II

Can you try -

=max(aggr(count({<Year = {'2018'}>}distinct behaviorDetail.incidentID),Student_Name))


or if you want the selected year instead of hard-coding it  the you can create a variable as vMaxYear=max(Year) and use this variable in the expression -

=max(aggr(count({<Year = {$(vMaxYear)}>}distinct behaviorDetail.incidentID),Student_Name))

View solution in original post

3 Replies
Highlighted
Specialist II
Specialist II

Can you try -

=max(aggr(count({<Year = {'2018'}>}distinct behaviorDetail.incidentID),Student_Name))


or if you want the selected year instead of hard-coding it  the you can create a variable as vMaxYear=max(Year) and use this variable in the expression -

=max(aggr(count({<Year = {$(vMaxYear)}>}distinct behaviorDetail.incidentID),Student_Name))

View solution in original post

Highlighted
Contributor
Contributor

Thanks, that did the trick.

On Tue, Sep 4, 2018 at 1:43 PM neelamsaroha1575 <qcwebmaster@qlikview.com>

Highlighted
Specialist II
Specialist II

I am glad it worked. can you please close the thread. Thanks