Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

Previous weeks on open

In my qvw i have the objects "YEAR", *MONTH", "YEARWEEK" and *DAY". "YEARWEEK" is e.g. '2018-01'.

When the qvw is opened i want to present data for the previous 4 weeks: E.g '2018-01', '2017-52', '2017-51' and '2017-50'

How do I do this?

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

just change the dimension formula.

see attached

hope this helps

View solution in original post

25 Replies
mdmukramali
Specialist III
Specialist III

Hi,

Stefan can you attach some sample data.

Thanks,

Mukram.

stekol61
Creator
Creator
Author

Enclosed are some sample data

mdmukramali
Specialist III
Specialist III

Hi Stefan,

You have a Date field in your data so based on Date you can Select the last 4 Weeks when you open QlikView Application.

Goto Document Properties --> Trigger -->Onopen --> Add Action --> Select in Field--> Field Date

Search String -->

= '>' & Date(Weekstart(Max(Date))-21, 'YYYY-MM-DD') & '<=' & Date(Max(Date), 'YYYY-MM-DD')

1410419.PNG

1410419_1.PNG

Kindly find the attached application for your reference.

Thanks,

Mukram.

stekol61
Creator
Creator
Author

Hi!

When using a master calender (as used in my app) or a filer for Year and Month the trigger doesn't work.

Any idea how this can be solved?

mdmukramali
Specialist III
Specialist III

Hi Stefan,

I didn't understand filter for Year and Month the trigger doesn't work?


you mean you want to see the last 4 Weeks Data in the Stright table even on the selection of filters?


Thanks,

Mukram.

stekol61
Creator
Creator
Author

Hi!

My original app uses a Master Calender.

What I'm looking for is that when the app opens it should show the previous 4 weeks as default.

The user can then use the Master Calender.to select a different time period

mdmukramali
Specialist III
Specialist III

Hi,

if you are using Master Calendar then also same trigger should work .

can you tell me :

what is the MaxDate in your Master Calendar?

stekol61
Creator
Creator
Author

Hi!

Not sure about MaxDate. I have not developed this Master Calendar.

However, without using Master Calendar and only use e.g. 'Year' and 'Month' filter the trigger doesn't work.

As you see in my previous enclosed app the Master Calendar is disabled.

mdmukramali
Specialist III
Specialist III

Hi,

In the Previous enclosed app the Master Calendar in working it's not disabled.

we have applied the trigger on Date Field so it's selected those dates which belong to last 4 weeks and remaining dates are in grey color because which do not belong to those 4 weeks.

like that only 2017-Dec and 2018-Jan are under those 4 Weeks so those are possible values remaining are not associated with those Weeks.

215236.PNG