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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
Master II
Master II

Change in dimension and calculation of measure

Hi All,

I have a report and chart by employee name salaries.

How to track the employee change in designation or promotion based on Hiredate and PromotionDate?

I want to calculate how much Salary he drwan with each designation.

Thanks in advance.

EMP:

LOAD * inline [

EMPNO,ENAME,JOB,MGR,HIREDATE,PRMOTIONDATE,SAL,COMM,DEPTNO

7369,JONES,Jr Engineer,7902,12/17/2000 0:00,8/29/2002 0:00,800,NULL,20

7369,JONES,Engineer,7902,10/23/2003 0:00,8/30/2002 0:00,1600,300,30

7369,JONES,Sr Engineer,7902,5/26/2005 0:00,4/1/2015 0:00,1250,500,30

7369,JONES,MANAGER,7839,4/2/2015 0:00,9/9/9999 0:00,2975,,20

]

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

EMP:

LOad Interval(PRMOTIONDATE-HIREDATE,'dd')/30 As Diff,(Interval(PRMOTIONDATE-HIREDATE,'dd')/30)*SAL ,*;

LOAD EMPNO,ENAME,JOB,MGR,Date#(HIREDATE,'MM/DD/YYYY hh:mm') As HIREDATE,Date#(PRMOTIONDATE,'MM/DD/YYYY hh:mm') As PRMOTIONDATE,SAL,COMM,DEPTNO inline [

EMPNO,ENAME,JOB,MGR,HIREDATE,PRMOTIONDATE,SAL,COMM,DEPTNO

7369,JONES,Jr Engineer,7902,12/17/2000 0:00,8/29/2002 0:00,800,NULL,20

7369,JONES,Engineer,7902,10/23/2003 0:00,2/19/2008 0:00,1600,300,30

7369,JONES,Sr Engineer,7902,5/26/2005 0:00,4/1/2015 0:00,1250,500,30

7369,JONES,MANAGER,7839,4/2/2015 0:00,9/9/9999 0:00,2975,,20

];

View solution in original post

6 Replies
anbu1984
Master III
Master III

Can you post expected output?

qlikviewwizard
Master II
Master II
Author

EMPNOENAMEJOBMGRHIREDATEPRMOTIONDATESALCOMMDEPTNOExpected O/PDuration in monthsTotal Earned
7369JONESJr Engineer790212/17/2000 0:008/29/2002 0:00800NULL2020.6666666716533.33333
7369JONESEngineer790210/23/2003 0:002/19/2008 0:00160030030106169600
7369JONESSr Engineer790211/15/2010 0:004/1/2015 0:0012505003094.93333333118666.6667
7369JONESMANAGER78394/2/2015 0:009/9/9999 0:002975 2097307.7289490407.5

anbu1984
Master III
Master III

How did you calculate duration?

qlikviewwizard
Master II
Master II
Author

(PRMOTIONDATE-HIREDATE)/30= no of months

anbu1984
Master III
Master III

EMP:

LOad Interval(PRMOTIONDATE-HIREDATE,'dd')/30 As Diff,(Interval(PRMOTIONDATE-HIREDATE,'dd')/30)*SAL ,*;

LOAD EMPNO,ENAME,JOB,MGR,Date#(HIREDATE,'MM/DD/YYYY hh:mm') As HIREDATE,Date#(PRMOTIONDATE,'MM/DD/YYYY hh:mm') As PRMOTIONDATE,SAL,COMM,DEPTNO inline [

EMPNO,ENAME,JOB,MGR,HIREDATE,PRMOTIONDATE,SAL,COMM,DEPTNO

7369,JONES,Jr Engineer,7902,12/17/2000 0:00,8/29/2002 0:00,800,NULL,20

7369,JONES,Engineer,7902,10/23/2003 0:00,2/19/2008 0:00,1600,300,30

7369,JONES,Sr Engineer,7902,5/26/2005 0:00,4/1/2015 0:00,1250,500,30

7369,JONES,MANAGER,7839,4/2/2015 0:00,9/9/9999 0:00,2975,,20

];

qlikviewwizard
Master II
Master II
Author

Thank you so much