Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Trying to figure out how to count month to date from two separate rows. I had it working, but had to make some changes. I need to count the MTD Misses when Program_Dash = 'Kit Build' or 'Kit Build - Timberline'.
I have tried putting the 'or' but the result is just a '-'
Please help.
In my script, I have this.
LOAD
Date_Dash,
Month(Date_Dash) as Month,
Num(Month(Date_Dash)) as MonthNum,
Year(Date_Dash) as Year,
MakeDate(year(Date_Dash)) as vCY,
MakeDate(month(Date_Dash)) as vCM,
If(Processed_Dash < Daily_Target_Dash, 1,0) as Daily_Target_Flag,
Program_Dash,
UOM_Dash,
Status_Dash,
Ave_Cost_Dash,
Processed_Dash,
Daily_Target_Dash,
Emp_Act_Dash,
Rev_Diff_Dash
FROM
(Count({<Daily_Target_Flag = {'1'}, Program_Dash={'Kit Build'},
Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},
Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}>}
DISTINCT Date_Dash))
Remove month and year from degrade in expression
But isn't that what counts the current month?
Yes, I am thinking without that it is working or not. Could you check the expression properly
I tried this, but it returns 0 for some reason. I am trying to get it to add the processed of Programs 'Kit Build' and 'Kit Build - Timberline' and whenever it is less than 'Kit Build' target_dash
If(
((Sum({<Program_Dash={'Kit Build - Timberline'},
Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},
Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}>}Processed_Dash))
+
(Sum({<Program_Dash={'Kit Build'},
Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},
Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}>}Processed_Dash)))
<
(Avg({<Program_Dash={'Kit Build'},
Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},
Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}>}Daily_Target_Dash))
, 1, 0)