Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
This is strange for sure... would you be able to share a qvw to investigate more?
Yes. I will get it ready soon.
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)