Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am having trouble getting the intersection set operator to work in an expression for a bar chart. I want to count the people who belong to both set operands but the expression is returning no data. In the raw data there are people who belong to both sets. The user needs to select the term of entry for the chart conditions to be fulfilled.
Advice would be appreciated.
Here is the expression I'm currently using;
count
({$<TermofEntry = {$(= only (TermofEntry))},
LevelCode = {'PGR'},
ExtractType = {1},
YearofProgram = {'1'},
RegStatusCode = {'RE','RS'},
InstanceTerm = {$(= only (TermofEntry))},
CollegeCode = {'AF', 'SF', 'HF'},
ResearchDoctMastInd = {R}, ModeofStudy = {'FT'}
> *
<TermofEntry = {$(= only (TermofEntry))},
LevelCode = {'PGR'},
ExtractType = {1},
YearofProgram = {'2'},
RegStatusCode = {'RE', 'RS'},
InstanceTerm = {$(= only (TermofEntry)+ 100)},
CollegeCode = {'AF', 'SF', 'HF'},
ResearchDoctMastInd = {'R'}, ModeofStudy = {'FT'}
>} pidm)
Yes,
that's what I said, I don't think the intersection operator works correctly between two set modifier. But have you tried using the intersection operator like suggested above, within one field element set expression?
Please see attached.
Stefan
I wasn't able to use the intersection operator between set modifiers in the past, too (only union and exclusion seem to work). But you can achieve something similar probably using
=count({<PersonKey =p( {<Year={2011}>})*p({<Year= {2012}>})>} distinct PersonKey)
count
({$
<pidm = p( {
<TermofEntry = {$(= only (TermofEntry))},
LevelCode = {'PGR'},
ExtractType = {1},
YearofProgram = {'1'},
RegStatusCode = {'RE','RS'},
InstanceTerm = {$(= only (TermofEntry))},
CollegeCode = {'AF', 'SF', 'HF'},
ResearchDoctMastInd = {R}, ModeofStudy = {'FT'}
> } )* p({
<TermofEntry = {$(= only (TermofEntry))},
LevelCode = {'PGR'},
ExtractType = {1},
YearofProgram = {'2'},
RegStatusCode = {'RE', 'RS'},
InstanceTerm = {$(= only (TermofEntry)+ 100)},
CollegeCode = {'AF', 'SF', 'HF'},
ResearchDoctMastInd = {'R'}, ModeofStudy = {'FT'}
>} )
>}
pidm)
Hope this helps and that I haven't missed a bracket here (I hope the idea is clear?)
Regards,
Stefan
Hi,
Thanks for this - the expression builder reads 'expression ok' but no data is being extracted. I can get the original expression working with a union operator but it's not outputting the correct data. Has anything else worked for you when using intersections?
Could you maybe upload a small sample file? Upload is available here using the advanced editor (follow link in editor).
Hello,
I've attached a small sample file. I have created similar charts using the intersection operator in one and the union operator in the other for the 'Progressed to year 2' expression but as you can see no data is displayed from the intersection expression.
Thanks,
Danielle
Yes,
that's what I said, I don't think the intersection operator works correctly between two set modifier. But have you tried using the intersection operator like suggested above, within one field element set expression?
Please see attached.
Stefan
Hi Stefan,
That's great - I've tried this in my actual model now and the intersection works. Thanks so much for your help with this.
Danielle