Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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))

4 Replies
Anil_Babu_Samineni

Remove month and year from degrade in expression

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
joshrussin
Creator III
Creator III
Author

But isn't that what counts the current month?

Anil_Babu_Samineni

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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)