Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
charlesdmeyer
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
neelamsaroha157
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
neelamsaroha157
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))

charlesdmeyer
Contributor
Contributor
Author

Thanks, that did the trick.

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

neelamsaroha157
Specialist II
Specialist II

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