Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
What's wrong with my expression?
Count({<[Dealer Hire Date] = {'<=12/31/2015'},[Dealer Term Date] = {"$(= '>=' & '01/01/2015' & '<=' & '12/31/2015')" or null}>}[Student ID])
I am trying to count Student ID where their Dealer Hire Date is Less Than or Equal to 12/31/2015 AND they either have a Dealer Term Date in-between the dates of 01/01/2015 - 12/31/2015 OR they don't have a Dealer Term Date.
My KPI object keeps returning the value of 0. I have a feeling my problem fall within how I am writing in the expression 'OR NULL'.
Suggestions on how to write this?
Check the attached
Script:
LOAD RowNo() as Key,
"Student ID",
"Dealer Hire Date",
"Dealer Term Date"
FROM [lib://Lib/SunnyT2.xlsx]
(ooxml, embedded labels, table is Sheet1);
Expression:
Count({<[Dealer Hire Date] = {"$(='<=' & '12/31/2015')"},[Dealer Term Date] = {"$(= '>=' & '01/01/2015' & '<=' & '12/31/2015')"}>+
<[Dealer Hire Date] = {"$(='<=' & '12/31/2015')"}, Key = {"=Len(Trim([Dealer Term Date])) = 0"}>}[Student ID])
Try this:
Count({<
[Dealer Hire Date] = {'<=12/31/2015'},
[Dealer Term Date] =
p(
1{
[Dealer Hire Date] = {'<=12/31/2015'},[Dealer Term Date] = {"$(= '>=' & '01/01/2015' & '<=' & '12/31/2015')")}
} [Dealer Hire Date]
)
>}
[Student ID])
Hope it helps
Regards,
MB
PS: this function was made using the help of the document provided by this post:
That didn't work. It returned a "-" in my KPI. Thanks for trying.
What is the range of dates you're trying to achieve in Dealer Hire Date?
I also think that the problem is the use of "or null" in Set Analysis expression. Let me search a bit more
Have you tried simply with this expression?
Count({<[Dealer Hire Date] = {'<=12/31/2015'},[Dealer Term Date] = {"1(= '>=' & '01/01/2015' & '<=' & '12/31/2015')"}>}[Student ID])
This gives me the value of 0.
I want the count of students who were hired before 12/31/2015.
And who are currently still employed (null for Dealer Term Date) or have a Dealer Term Date between 01/01/2015 and 12/31/2015.
I'm trying to get the beginning population for the year of 2015.
Give this a try:
Count({<
[Dealer Hire Date] = {'<=12/31/2015'},
[Dealer Term Date] = {"$(= '>=' & '01/01/2015' & '<=' & '12/31/2015')")} + {''}
>}
[Student ID])
Regards,
MB
Returns a "-"
Maybe this:
Count({<
[Dealer Hire Date] = {'<=12/31/2015'},
[Dealer Term Date] = {"$(= '>=' & '01/01/2015' & '<=' & '12/31/2015')")},
[Dealer Term Date] = {"$(=null())"}
>}
[Student ID])
Regards,
MB