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: 
amars
Specialist
Specialist

Converting an aggr into Set Analysis

Hi all,

I have a Pivot Table whose Dimension is a Circular Group containing multiple Fields.

In the pivot I show bifurcation of student by the no of courses they are doing (1, 2, 3,4,5 & >5  Total Students).

For students doing 2 courses my expression is like this

Count(distinct If(Aggr(Distinct Count(Distinct if(FullTimeStudFlag=1,Course_Id)),Student_ID, "$(vGetFieldSelected)")=2,Student_ID))

If someone could suggest equivalent expression in Set Analysis.

Here "$(vGetFieldSelected)" is the Field Selected within the Circular Group in the Dimension, directly writing getcurrentfield ("GroupName") is not working.

Thanks in advance.

Amar

3 Replies
swuehl
MVP
MVP

Try maybe like this

=count(DISTINCT {<Student_ID = {"=count(DISTINCT {<FullTimeStudFlag = {1}>} Course_Id)=2"} >} Student_ID)

amars
Specialist
Specialist
Author

Sorry Swehel the expression is working find only for few Fields inside the Circular Group.

Thanks a lot for the help.

Can I ask you one more question in my Aggr I am taking Count of Course ID Grouped by Student & Selected Dimension. How the inner expression "{"=count(DISTINCT {<FullTimeStudFlag = {1}>} Course_Id)=2"}" is supposed to achieve the same. Simply how the Aggr is applied on StudentID and Selected Dimension using this expression ?

Thanks again....

Amar

swuehl
MVP
MVP

You are right, that's not a exact conversion. The count in the set expression field modifier is only grouped by Student. You can integrate the aggr() in the search expression of the field modifier, but that probably won't much better your current expression.

It's quite hard to tell you a better solution without knowing your data model and your dimensions / expressions / cycle group in detail, so if possible, it would be very helpful if you could post a small sample qvw.

Advanced aggregation (aggr() function) and set analysis are two different things, so it's not always possible to replace something with the other.