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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Texas_Dave
Contributor
Contributor

Help with calculated field

I'm pulling a count of employees, and need to make a calculated field for a count of "New Hires". I am new to Qlik Sense but have worked in Tableau. The syntax is throwing me for a loop here. 

I have it written in Tableau as:

COUNTD (IF DATEDIFF ('day',[Date Hired], DATEADD('day',-1,TODAY () ) ) <=45 THEN [Worker ID] END )

 

So far in Qlik Sense I have:

Count(IF Date('day',[Worker.HireDate], ' day',-1, Today () <=14 THEN [Worker.Wkr_ID] END)

 

Any help on the Qlik syntax would be greatly appreciated. 

2 Replies
mahaveerbiraj
Creator II
Creator II

Hi ,

if ( ([Worker.HireDate] - Today ())<45, [Worker ID] )  as newfield 

and  take count in chart  using  count(distinct  newfield ) 

 

Note: take care of date format

Texas_Dave
Contributor
Contributor
Author

Thank you for the response. Is there a way to get it into one statement?