Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate daily basis achievement

I am having two tables Sales and Target . As below, I have sales data on daily basis and target on the monthly basis and it should exclude targets on public holidays as well as on weekend.

Sales:

Load * Inline [

Date, Sales

01-08-2018, 10

02-08-2018, 20

03-08-2018, 50

.

.

.

30-08-2018, 70

];

Target:

Load * Inline [

Month, Target

August-2018, 1200

];

and I want to calculate achievement on daily basis in terms of percentage. How will I calculate this?

Immediate help and the perfect logic will be appreciated .

Thanks and regards,

Yogendra W.

1 Reply
OmarBenSalem

Do sthing like this :

//Create a Month Field in ur Sales table to link it to the Target Table ; one way to do (depends on ur data)

Sales:

Load date(Date#(Date,'DD-MM-YYYY'))  as Date,

Capitalize(date(MonthStart(date(Date#(Date,'DD-MM-YYYY'))),'MMMM-YYYY')) as Month,

Sales

Inline [

Date, Sales

01-08-2018, 10

02-08-2018, 20

03-08-2018, 50

04-08-2018, 10

05-08-2018, 20

06-08-2018, 50

07-08-2018, 10

08-08-2018, 20

09-08-2018, 50

10-08-2018, 10

11-08-2018, 20

12-08-2018, 50

13-08-2018, 10

14-08-2018, 20

15-08-2018, 50

16-08-2018, 10

17-08-2018, 20

18-08-2018, 50

19-08-2018, 10

20-08-2018, 20

21-08-2018, 50

22-08-2018, 10

23-08-2018, 20

24-08-2018, 50

25-08-2018, 10

26-08-2018, 20

27-08-2018, 50

28-08-2018, 10

29-08-2018, 20

30-08-2018, 70

31-08-2018, 190

01-09-2018, 10

02-09-2018, 20

03-09-2018, 50

04-09-2018, 10

05-09-2018, 20

06-09-2018, 50

07-09-2018, 10

08-09-2018, 20

09-09-2018, 50

10-09-2018, 10

11-09-2018, 20

12-09-2018, 50

13-09-2018, 10

14-09-2018, 20

15-09-2018, 50

16-09-2018, 10

17-09-2018, 20

18-09-2018, 50

19-09-2018, 10

20-09-2018, 20

21-09-2018, 50

22-09-2018, 10

23-09-2018, 20

24-09-2018, 50

25-09-2018, 10

26-09-2018, 20

27-09-2018, 50

28-09-2018, 10

29-09-2018, 20

30-09-2018, 270

];

Target:

Load Capitalize(date(MonthStart(date#(Month,'MM-YYYY')),'MMMM-YYYY')) as Month, Target Inline [

Month, Target

08-2018, 1200

09-2018, 1000

];

In ur line chart:

Dimension: Date

Measure:

aggr(

RangeSum(Above(

Sum({<Date>}Sales)

,0, RowNo()))

,Month, (Date,(Numeric,Ascend)))

/ sum(total <Month> Target)

Or use a dimension : Day(Date) and keep the same measure:

Result:

Capture.PNG