Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
djallelsadki
Partner - Creator
Partner - Creator

Set Analysis problem

Hello,

If anyone can help me, thank you in advance

I have a list of students who have expressed wishes (school choice)

I need to calculate the following indicators (by school):

- Number of students rated school (value of the dimension) -> OK

- Number of students rated school in addition to a School "Y" (variable) -> OK

- Number of students who ranked the best school that the school Y -> I need help on this expression

See attached file

Thanks,

Best regards,

D.Sadki

1 Solution

Accepted Solutions
djallelsadki
Partner - Creator
Partner - Creator
Author

I found the solution

Count(distinct if(aggr(only({1}Wish)-Only({<Y_School_Wish.SchoolKey={"$(vSelectSchool)"}>}Y_Wish),SchoolKey,StudentKey)<0,StudentKey))

Thanks

View solution in original post

5 Replies
petter
Partner - Champion III
Partner - Champion III

I think this expression should do the trick:

2015-09-06 #3.PNG

I haven't tested it properly against your data - so I will do that and come back to you unless you verify first and confirm...

djallelsadki
Partner - Creator
Partner - Creator
Author

Hi,

I'm sorry but this is not working

Best regards,

D.Sadki

jonathandienst
Partner - Champion III
Partner - Champion III

>>Number of students who ranked the best school that the school Y

This is not clear which is best - the first school or school Y?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
djallelsadki
Partner - Creator
Partner - Creator
Author

Hi,

sorry I misspoke,

The best school is the one that has a lower wish...


Exemple :


StudentKey SchoolKey Wish

146               213           1

146               82             2

146               209           3

146               609           4

146               208           5

146               206           6

146               126           7

146               196           8

146               212           9

146               92             10

146               227           11


SchoolKey Y = 92

Number of student who ranked = 1 ( 9 Wish before the school 92) and so on

I want to count all the student that satisfied this condition in a st table with only School as dimension


Thanks


Best regards,


D.Sadki

djallelsadki
Partner - Creator
Partner - Creator
Author

I found the solution

Count(distinct if(aggr(only({1}Wish)-Only({<Y_School_Wish.SchoolKey={"$(vSelectSchool)"}>}Y_Wish),SchoolKey,StudentKey)<0,StudentKey))

Thanks