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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
elie_issa
Creator II
Creator II

Date Not working properly in Set analysis


Dear All,


I am trying to generate results using below expression. The results are totally fine when selecting a week year but they are totally wrong when not filtering because the selection of the date below is not taking the master calendar of the same row.



Expression :


count({<

          [Country]          = {'test'},

        [Nationality]      = {'test'},                   

      [Group Engagement Date]  = {"<=$(=date($(vMasterCalendar)))"},

      [Group Termination Date] = {">=$(=date($(vMasterCalendar)))"},

        [Assignment SDate]      = {"<=$(=date($(vMasterCalendar)))"},

        [Assignment EDate]      = {">=$(=date($(vMasterCalendar)))"},

        [Person SDate]          = {"<=$(=date($(vMasterCalendar)))"},

        [Person EDate]          = {">=$(=date($(vMasterCalendar)))"},

      [Person Type Category]  -= {'Daily Hired'}

    />}distinct [Employee Number])

vMasterCalendar :    =only({<Year=P(Year),Quarter=P(Quarter),[Month Year]=P([Month Year]),[Week Year]=P([Week Year]),[Month                                                        Num]=P([Month Num]),Month=P(Month),Day=P(Day)>}Num([Master Calendar Date]))

Results : Capture attached right number highlighted in yellow and the results are fine when choosing a week year but they are wrong when we don't make any filter (Wrong Numbers Attach)

          

ali_hijazi

11 Replies
elie_issa
Creator II
Creator II
Author

it's working fine now thanks for the help sunny

count({<

        [Country]           = {'test'},

        [Nationality]       = {'test'},                  

  [Person Type Category]  -= {'Daily Hired'}

>

}distinct (if( [Group Engagement Date] <= [Master Calendar Date]

               and [Group Termination Date] >= [Master Calendar Date]

               and [Assignment SDate] <= [Master Calendar Date] 

               and [Assignment EDate] >= [Master Calendar Date]

               and [Person SDate]     <=  [Master Calendar Date]

               and [Person EDate]     >=  [Master Calendar Date] ,[Employee Number])))

sunny_talwar

This should work also,

Count({<[Country] = {'test'}, [Nationality] = {'test'}, [Employee Number] = {"=

                      [Group Engagement Date] <= [Master Calendar Date]

               and [Group Termination Date] >= [Master Calendar Date]

               and [Assignment SDate] <= [Master Calendar Date]

               and [Assignment EDate] >= [Master Calendar Date]

               and [Person SDate]     <=  [Master Calendar Date]

               and [Person EDate]     >=  [Master Calendar Date]

"}, [Person Type Category]  -= {'Daily Hired'}>} DISTINCT [Employee Number])