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

Set analysis aggregation for a field with multiple values

Hi,

I have the following set analysis that works to give student course completion for students having Status_value as 1-Junior

=sum(aggr(count (DISTINCT {$<[StudentId]={"=[Status_Value]='1-Junior'" } >} if ($(vrDateRange), [StudentId]) ),[Course Number], [ResultEnd Date]))

I want to modify the above expression to give me a total count of student course completion across all Status_values. I tried the following but got 0 as result.

=sum(aggr(count (DISTINCT {$<[StudentId]={"=[Status_Value]='1-Junior', '2- Sophomore'" } >} if ($(vrDateRange), [StudentId]) ),[Course Number], [ResultEnd Date]))


Kindly suggest!

6 Replies
vishsaggi
Champion III
Champion III

Try this?

=sum(aggr(count (DISTINCT {$<[StudentId]={"=[Status_Value]= { '1-Junior', '2- Sophomore'} " } >} if ($(vrDateRange), [StudentId]) ),[Course Number], [ResultEnd Date]))

Anil_Babu_Samineni

May be try this

=sum(aggr(count (DISTINCT {$<[StudentId] = , [Status_Value] = {'1-Junior', '2- Sophomore'} >} if ($(vrDateRange), [StudentId]) ),[Course Number], [ResultEnd Date]))


Or


=sum(aggr(count (DISTINCT {$<[StudentId]={"=[Status_Value]={'1-Junior', '2- Sophomore'}" } >} if ($(vrDateRange), [StudentId]) ),[Course Number], [ResultEnd Date]))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Tried. Returns 0

Not applicable
Author

First expression does not return correct value. 2nd expression returns 0

sunny_talwar

May be this:

=Sum(Aggr(Count (DISTINCT {$<[StudentId] = {"=Match([Status_Value], '1-Junior', '2- Sophomore')"}>} if ($(vrDateRange), [StudentId])), [Course Number], [ResultEnd Date]))

or this

=Sum(Aggr(Count (DISTINCT {$<[Status_Value] =  {'1-Junior', '2- Sophomore'}>} if ($(vrDateRange), [StudentId])), [Course Number], [ResultEnd Date]))

Anil_Babu_Samineni

May be remove "=" and then check

or else use Match function to retrieve the same

Match(Dim,'Value1','Value2')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful