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

Adding a Field in a Group(Cyclic) to display latest two weeks

Hi

In one of my pivot table I have a group called as Time. Which contains fields such as =Week(date),=Year(date),=WeekName(date) and =MonthName(date). With that I want to one more fields which calculates only 2 weeks of data. It should show latest 2 weeks date only.

I tried something like =Date(Max(date)-14) but it didn't work.

Can some one help me out on this please.

Thanks

Rikeb

43 Replies
vgutkovsky
Master II
Master II

Rikeb,

When I've developed this functionality in my own applications, I've left the dimension alone and just modified the expression. Just add a valuelist('Last 2 Weeks') to your cycle group. Then, in your expression, use GetCurrentField to check if you're on the "Last 2 Weeks" dimension and, if so, use set analysis to restrict your dates.

Regards,

deepakk
Partner - Specialist III
Partner - Specialist III

hi Attitude,

Try out this application.

Not applicable
Author

Hi Deepak

Thanks for your reply. There is nothing in the application. Please attach the correct file.

Not applicable
Author


Vlad Gutkovsky wrote:
When I've developed this functionality in my own applications, I've left the dimension alone and just modified the expression. Just add a valuelist('Last 2 Weeks') to your cycle group. Then, in your expression, use GetCurrentField to check if you're on the "Last 2 Weeks" dimension and, if so, use set analysis to restrict your dates. <div></div>


Hi Vlad

Can you please attach the sample application. I am not able to understand what is meant my value list. If you can attach any sample application it will be easy for my understanding.

vgutkovsky
Master II
Master II

I don't have a sample application handy. Look in the Help file for valuelist (it's basically just a way of adding a hardcoded dimension).

Regards,

Not applicable
Author

Hi Vlad

I have attached the sample application for your understanding. Can you please work on it.

Hope others also can have a look at it. As I have attached the sample application it will be easy for you.

deepakk
Partner - Specialist III
Partner - Specialist III

EmbarrassedSorry.

I modify the your application. PFA

Not applicable
Author

Hi Deepak

Thanks a ton! You have done a excellent job. Hats of to you...

By the way I want one more thing from you when you are free. I want RED color in the background for those columns(date) which falls on weekends(Saturday & Sunday). Could you please try that in the application attached by me previously.

deepakk
Partner - Specialist III
Partner - Specialist III

Happy to Help Smile.

PFA for the sunday part.