Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
joshrussin
Creator III
Creator III

MTD Target Misses

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))

Labels (1)
4 Replies
Anil_Babu_Samineni
MVP
MVP

Remove month and year from degrade in expression

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
joshrussin
Creator III
Creator III
Author

But isn't that what counts the current month?

Anil_Babu_Samineni
MVP
MVP

Yes, I am thinking without that it is working or not. Could you check the expression properly

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
joshrussin
Creator III
Creator III
Author

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)