Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
baylor2016
Creator
Creator

What are the differences between these three set analyses?

Hi,

I am working on a chart using set analysis and do not know why the following two give different results. What I am trying to do is to combine the union and intersection to get the number I need. If I can figure out this, my problem should be solved.

Thanks

This one returns 940

=count(DISTINCT 
{<
YearMonth,
FLAG_IVD={1},
CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},
PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18"},
VISITTYPE={'Office visit'},
FCMVISIT={1}
>}
PAT_ID

This one returns 118

count(DISTINCT 
{
<FLAG_IVD={1}, YearMonth>*
<
YearMonth,
CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},
PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18"},
VISITTYPE={'Office visit'},
FCMVISIT={1}
>
}
PAT_ID

This one only returns 1

count(DISTINCT 
{
<FLAG_IVD={1}>*
<
YearMonth,
CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},
PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18"},
VISITTYPE={'Office visit'},
FCMVISIT={1}
>
}
PAT_ID)

12 Replies
sunny_talwar

This is strange for sure... would you be able to share a qvw to investigate more?

baylor2016
Creator
Creator
Author

Yes. I will get it ready soon.

vinieme12
Champion III
Champion III

You can validate the output manually for each of your set expressions, that will help you understand what exactly you are getting.

1)

Download data For the first expression:

=count(DISTINCT 
{<
YearMonth,
FLAG_IVD={1},
CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},
PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18"},
VISITTYPE={'Office visit'},
FCMVISIT={1}
>}
PAT_ID)

2)

break the below in two expressions and download data for each set separately and verify

remember * is the intersection, so use vlookup to check what PAT_ID were common between both sets

that is the output you are getting

count(DISTINCT 
{
<FLAG_IVD={1}, YearMonth>*
<
YearMonth,
CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},
PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18"},
VISITTYPE={'Office visit'},
FCMVISIT={1}
>
}
PAT_ID)

          Expressions (Disable the other expression alternately before downloading the data)

                    a) count(DISTINCT {<FLAG_IVD={1}, YearMonth> }PAT_ID)

                      b)) count(DISTINCT { <

                                        YearMonth,

                                        CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' &                                              Date(V_selectedDate))"},

                                        PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18"},

                                             VISITTYPE={'Office visit'},

                                        FCMVISIT={1}

                                        >}PAT_ID)

As above break into two expressions and download data for each expression individually and verify what values are returned

count(DISTINCT 
{
<FLAG_IVD={1}>*
<
YearMonth,
CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},
PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18"},
VISITTYPE={'Office visit'},
FCMVISIT={1}
>
}
PAT_ID)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.