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: 
Anonymous
Not applicable

Rating Calculation for specific time interval

Hi,

Kindly find the attached screen,

1. I have scenarios where I will have many no.of AppraisalDates(AppraisalStartDate,AppraisalEndDate) and I want to calculate the  Final Rating by adding up for last 6 months(AppraisalEndDate: 7/12/2017-12/30/2017) as Current Rating and previous 6 months(AppraisalEndDate: 1/31/2017-6/30/2017) as Previous Rating.

2. And also I want to show the Start and End Months in chart like 'Jan to June'

   Can anyone suggest me how we can do that?

3 Replies
aarkay29
Specialist
Specialist

let vCurrentYear=year(Today());

Load

    Rating,

    ID,

    AppraisalPeriodToDate,

    If(

          Date(AppraisalPeriodToDate)>=MakeDate($(vCurrentYear),01,01)

    and

          Date(AppraisalPeriodToDate)<=MakeDate($(vCurrentYear),06,30),'Previous','Current') as Flag;

Load * Inline [

AppraisalPeriodToDate,Rating,ID

1/31/2017,7,1

2/28/2017,7,1

3/31/2017,8,1

4/30/2017,6,1

5/31/2017,7,1

6/30/2017,15,1

7/31/2017,7,1

8/28/2017,7,1

9/30/2017,8,1

10/30/2017,6,1

11/30/2017,7,1

12/30/2017,10,1

];

Use expressions in the front end

Previous rating -Sum({<Flag={"Previous"}>}Rating)

Current rating -Sum({<Flag={"Current"}>}Rating)

Anonymous
Not applicable
Author

But if an employee starts the appraisal date from April(4/30/2016) to March(3/30/2017) how it will change dynamically  and  i want show  first 6 month as  previous rating and next 6 months as current ratingrating.PNG

I want to show like this

aarkay29
Specialist
Specialist

Check it out