Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

If statement

I am trying to add 'Kit Build' and 'Kit Build - Timberline' when Program_Dash = 'Kit Build', the result I am getting from this is just '-' in the column. Any Help?

=if (Program_Dash = {'Kit Build'},

((Sum(aggr(

        ((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

        Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}, Program_Dash = {'Kit Build'}>} (Ave_Cost_Dash * Processed_Dash)))

        /(sum(vDays_Con))) * (Sum(vDay_in_M))

        ,Date_Dash, Program_Dash, Status_Dash)))

    +

    (Sum(aggr(

        ((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

        Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}, Program_Dash = {'Kit Build - Timberline'}>} (Ave_Cost_Dash * Processed_Dash)))

        /(sum(vDays_Con))) * (Sum(vDay_in_M))

        ,Date_Dash, Program_Dash, Status_Dash))))

       

,

    (Sum(aggr(

((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}>} (Ave_Cost_Dash * Processed_Dash)))/(sum(vDays_Con))) * (Sum(vDay_in_M))

,Date_Dash, Program_Dash, Status_Dash))))

1 Solution

Accepted Solutions
Highlighted

May be this

=if (Program_Dash = 'Kit Build',

((Sum(TOTAL <Date_Dash, Status_Dash> aggr(

        ((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

        Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}, Program_Dash = {'Kit Build'}>} (Ave_Cost_Dash * Processed_Dash)))

        /(sum(vDays_Con))) * (Sum(vDay_in_M))

        ,Date_Dash, Program_Dash, Status_Dash)))

    +

    (Sum(TOTAL <Date_Dash, Status_Dash> aggr(

        ((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

        Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}, Program_Dash = {'Kit Build - Timberline'}>} (Ave_Cost_Dash * Processed_Dash)))

        /(sum(vDays_Con))) * (Sum(vDay_in_M))

        ,Date_Dash, Program_Dash, Status_Dash))))

  

,

    (Sum(aggr(

((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}>} (Ave_Cost_Dash * Processed_Dash)))/(sum(vDays_Con))) * (Sum(vDay_in_M))

,Date_Dash, Program_Dash, Status_Dash))))

View solution in original post

2 Replies
Highlighted

May be this

=if (Program_Dash = 'Kit Build',

((Sum(TOTAL <Date_Dash, Status_Dash> aggr(

        ((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

        Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}, Program_Dash = {'Kit Build'}>} (Ave_Cost_Dash * Processed_Dash)))

        /(sum(vDays_Con))) * (Sum(vDay_in_M))

        ,Date_Dash, Program_Dash, Status_Dash)))

    +

    (Sum(TOTAL <Date_Dash, Status_Dash> aggr(

        ((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

        Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}, Program_Dash = {'Kit Build - Timberline'}>} (Ave_Cost_Dash * Processed_Dash)))

        /(sum(vDays_Con))) * (Sum(vDay_in_M))

        ,Date_Dash, Program_Dash, Status_Dash))))

  

,

    (Sum(aggr(

((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}>} (Ave_Cost_Dash * Processed_Dash)))/(sum(vDays_Con))) * (Sum(vDay_in_M))

,Date_Dash, Program_Dash, Status_Dash))))

View solution in original post

Highlighted
Creator III
Creator III

Why doesn't this add the two? I am trying to get MTD revenue. This just shows Kit Build, not both kit build and kit build - timberline.

=if (Program_Dash = 'Kit Build',

((Sum(TOTAL <Date_Dash, Status_Dash> aggr(

        ((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

        Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}, Program_Dash = {'Kit Build'}>} (Ave_Cost_Dash * Processed_Dash)))

        )

        ,Date_Dash, Program_Dash, Status_Dash)))

    +

    (Sum(TOTAL <Date_Dash, Status_Dash> aggr(

        ((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

        Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}, Program_Dash = {'Kit Build - Timberline'}>} (Ave_Cost_Dash * Processed_Dash)))

        )

        ,Date_Dash, Program_Dash, Status_Dash))))

 

,

    (Sum(aggr(

((Sum({$<Status_Dash={'Completed'}, Month = {"$(=Month(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"},

Year = {"$(=Year(FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00'),1,$(vHolidays))))"}>} (Ave_Cost_Dash * Processed_Dash))))

,Date_Dash, Program_Dash, Status_Dash))))