Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
cbutcher
Partner - Contributor II
Partner - Contributor II

Set analysis with multiple Date Variables

Help Please i'm have difficulty with Set below basically I need to select only ID's for a date range that are in the second date range.

This works with the static 2013 year selected:

=Count(Distinct {<_LK_Period={">=$(SelectDateFrom) <=$(SelectDateTo)"}, [PlayerMaster PeopleID] = {"=Count(Distinct {<[PlayerMaster Year Registered] = {2013}>}  [PlayerMaster PeopleID])>0"} >}[PlayerMaster PeopleID])

What I have been trying to do is get the second date range based on 2 other variable SelectDateFromPre and SelectDateFromToEand

These are the same SelactDateFrom and SelectDateTo but with Addmonths()-12 to give the previous years data.

=Count( {<_LK_Period={">=$(SelectDateFrom) <=$(SelectDateTo)"}, [PlayerMaster PeopleID] = {=Count({$ <_LK_Period={">=$(=SelectDateFromPre) <=$(=SelectDateToPre)"} >}[PlayerMaster PeopleID])>0 } >}Distinct [PlayerMaster PeopleID])

Any help would be appreciated.

Thanks

Chris

1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe

=Count( {<_LK_Period={">=$(SelectDateFrom) <=$(SelectDateTo)"}, [PlayerMaster PeopleID] = {"=Count({$ <_LK_Period={'>=$(=SelectDateFromPre) <=$(=SelectDateToPre)'} >}[PlayerMaster PeopleID])>0" } >}Distinct [PlayerMaster PeopleID])

View solution in original post

2 Replies
maxgro
MVP
MVP

maybe

=Count( {<_LK_Period={">=$(SelectDateFrom) <=$(SelectDateTo)"}, [PlayerMaster PeopleID] = {"=Count({$ <_LK_Period={'>=$(=SelectDateFromPre) <=$(=SelectDateToPre)'} >}[PlayerMaster PeopleID])>0" } >}Distinct [PlayerMaster PeopleID])

cbutcher
Partner - Contributor II
Partner - Contributor II
Author

You sir are a star

Thanks

Chris