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: 
LP27
Creator II
Creator II

Display 4 weeks data in pivot table in Qlik Sense

Hi Everyone,

 

I have got the below case of displaying  only 4 weeks of data in Pivot table.

This is my pivot table-

Emp NoWeek 51Week - 50Week - 49Week - 48Week - 47
001-24-1
003-48-8
004-8--7
002--272

 

So now i want to display only last two weeks, Since today is Week-50, I need to display only column Week - 50 and Week-49.

And i am using sum(salary) as Measure. I also need to display only those salary that are Dashes in last 2 weeks . 

Like the below -

Emp NoWeek - 50Week - 49
0048-
002-2

 

 Please let me know if you have question.

Thanks in Advance.

 

Labels (5)
25 Replies
LP27
Creator II
Creator II
Author

No Luck with the Expression.

😞

Taoufiq_Zarra

try this version,

I changed the table pivot to a simple table

the formula is quite long, but I think it answers your need

Capture.PNG

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
sunny_talwar

May be this?

Sum({<EmpNo = {"=Count({<Week = {[>=$(=Max(Week)-1)<=$(=Max(Week))]}>} EmpNo) = 1"}, Week = {">=$(=Max(Week)-1)<=$(=Max(Week))"}>}Sales)

image.png 

Taoufiq_Zarra

elegant @sunny_talwar  formula as usual,
but in case we are in week 1 of the year week -1 must be 52?
I'm still learning 😉

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
sunny_talwar

You are right... I would rather use WeekYear instead of Week field to address situations like those.

LP27
Creator II
Creator II
Author

I tried with my dataset but was not successful in getting the output.

I am looking for the last 4 week data actually. ( I am trying to see Emp who has Dash's in Actual Time for 4 weeks in row)

I am sharing the App below.

let me know your views.

 

 

sunny_talwar

What is the expected output now?

LP27
Creator II
Creator II
Author

I am expecting to display-

The List of Employees with Dash's or hyphen's for the last 4 weeks in [Actual Time] Measure.

something like this below-

Emp ID W53W52W51W50
00001-8-7
00002----
0200088--
sunny_talwar

Why do you have Fin and Book table not connected to each other?

LP27
Creator II
Creator II
Author

Sorry @sunny_talwar 

I guess I missed the connection.

Please find the updated App attached below.

 

Thanks!