Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bri_na
Contributor
Contributor

Matching Field Value in Set Analysis

Hello,
Is it possible to pass only the value from a field (i.e. no associations) using set analysis?

 

For example, here's what I am trying to achieve:

 

I have records with multiple date stamps, including: Date1 and Date2. These may or may not be on the same day (but if different, Date2 is subsequent to Date1).

 

In a straight table, I would like to count the number of records where Date2 is the same date as a date selected from a filter pane containing Date1 dates (but not necessarily also where Date2 = Date1). 

 

Here is the expression that I am working from:

 

=Num(Count({$<Date2 = {">=$(=Date(min(Date1)))<=$(=Date(max(Date1)))"}>}DISTINCT ID,'#,##0'))

 

If I select all dates in April 2022 via a filter pane using the Date1 dimension, the expanded expression in the expression editor preview shows:

 

=Num(Count({$<Date2 = {">=2022-04-01<=2022-04-30"}>}DISTINCT ID),'#,##0'))

 

The result I get in my table is a count of records where the Date1 is between April 1 and 30th 2022 AND where Date2 = Date1
 
 
However, what I want is a count of records where Date2 is between April 1 and 30th 2022 (or whatever date range the end user selects using Date1 in the filter pane), and NOT necessarily where Date2 = Date1.
 

 

In other words, I want to get the date value from selected Date1 dates, and get a count of ID where Date2 is the same date value as the date selection made using Date1 in the filter pane.
 

 

Can anyone offer a solution to achieve this? 

 

 
Much appreciated !!
Labels (5)
1 Reply
rubenmarin

Hi, I'm not sure to undesrtand the "same date but not necessarily Date2=Date1" part, in case it helps, can you try with P()?: https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalysi...

Somewaht like: =Num(Count({$<Date2 = P(Date1)>}DISTINCT ID,'#,##0'))