Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
wcoleman0908
Partner - Contributor III
Partner - Contributor III

Set Analysis not returning the desired results

I've been unsuccessful in getting this stuburn code to work correctly. What I'm attempting is to return is all records where:

1) The [project status] is open

2) Return those projects where NO projects have any values with a  [completion status] equal to 'In_Prog'

The problem is that it returns projects but includes those projects with 'In_Prog' data values. My task is to Complete those projects that are open that are no longer 'In_Prog'

My set Analysis is as follows:

Count(aggr(Count({<[Project Status]={'Open'},[Completion Status]-= {'In Progress'}   > }distinct [Projects]), [Projects))

I included a sample data file for testing, Any insights would be great

Labels (1)
3 Solutions

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Hi, perhaps this.

=Count({$<[Project Status]={'Open'}, [Projects] -= P({<[Completion Status]={'In_Prog'}>} [Projects])>} DISTINCT [Projects])

View solution in original post

BrunPierre
Partner - Master
Partner - Master

As a filter pane or calculated dimension use this

=Aggr(Only({$<[Project Status]={'Open'}, [Projects] -= P({<[Completion Status]={'In_Prog'}>} [Projects])>} [Completion Status]), [Completion Status])

BrunPierre_0-1697058357763.png

View solution in original post

coleturegroup
Contributor III
Contributor III

=count(Aggr(Only({$<[Project Status]={'Open'}, [Projects] = E({<[Completion Status]={'In Progress'}>} [Projects])>} Group, [Completion Status]), [Completion Status]))


Thanks but unfortunately it didn't work as desired. Maybe i need to add more detail to show my results.

I included the updated QVF file, the table below show only show the following results:

Group C should only show project 7300, 8728

Group E should only show project 9035, 9163

Group F should only show project 6753, 8605

The Aggr seems to not be formed properly, can you see the issue?

Thanks in advance for all your help

View solution in original post

10 Replies
BrunPierre
Partner - Master
Partner - Master

Hi, perhaps this.

=Count({$<[Project Status]={'Open'}, [Projects] -= P({<[Completion Status]={'In_Prog'}>} [Projects])>} DISTINCT [Projects])

wcoleman0908
Partner - Contributor III
Partner - Contributor III
Author

No that returned In prog project records too. It needs to return a list of projects that have NO 'in_prog' records.

😞

 

BrunPierre
Partner - Master
Partner - Master

 isn't this what you want?

BrunPierre_0-1697051509271.png

coleturegroup
Contributor III
Contributor III

Here is what i'm seeing locally still getting returned

coleturegroup_2-1697053294617.png

 

 

 

coleturegroup
Contributor III
Contributor III

See here:

coleturegroup_0-1697053583334.png

 

BrunPierre
Partner - Master
Partner - Master

As a filter pane or calculated dimension use this

=Aggr(Only({$<[Project Status]={'Open'}, [Projects] -= P({<[Completion Status]={'In_Prog'}>} [Projects])>} [Completion Status]), [Completion Status])

BrunPierre_0-1697058357763.png

coleturegroup
Contributor III
Contributor III

Holly cow this is very painful, It still shows, look at project 8892

coleturegroup_0-1697060034866.png

 

BrunPierre
Partner - Master
Partner - Master

Add the count measure to filter the result.

BrunPierre_0-1697061429639.png

MayilVahanan

Hi

One of the way to achieve this ,

Count({<[Project Status]={'Open'}, Projects-={$(=Concat({<[Completion Status]={'In_Prog'}>}Distinct Projects, ','))}>}DISTINCT Projects)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.