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: 
benjamins
Partner - Creator
Partner - Creator

How to display data for 9 weeks ago until current week

I'm trying to create a bar diagram with exactly ten bars. Each bar should display data, the first one from 9 weeks ago, the last one from the current week.

I've experimented around with set analysis but to no avail.

Any help appreciated!

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

Look at the attached document.

Regards

ASHFAQ

View solution in original post

11 Replies
Gysbert_Wassenaar

It really depends on your data. Can you post a small example document with some data? See this document for how to do that safely: Preparing examples for Upload - Reduction and Data Scrambling


talk is cheap, supply exceeds demand
benjamins
Partner - Creator
Partner - Creator
Author

I see!

Attached you find a sample.

My goal is to have the diagramm show exactly ten bars - the last being this week and the first nine weeks ago.

ThornOfCrowns
Specialist II
Specialist II

Change your first dimension to:

=if(DateId>=Today()-63 and DateId <=Today()-0,YearWeek)

and set the "Supress when value is  Null" tickbox

ashfaq_haseeb
Champion III
Champion III

Hi,

may be like this.

Regards

ASHFAQ

benjamins
Partner - Creator
Partner - Creator
Author

Not bad, but there are two issues with this solution:

1.) Categories have to be selected (even though I don't get why).

2.) The last one isn't the current week, but the last week for which there is data. While in theory this should be the current week, this isn't the case in the real world. Example: A ship is estimated to arrive in three days, but is already there, the data would be counted as punctual and thus would ruin the chart.

benjamins
Partner - Creator
Partner - Creator
Author

This was my initial thought as well. On a Monday this is correct. But on any other day the first week is incomplete.

ashfaq_haseeb
Champion III
Champion III

Hi,

1) as you don't have data for max week which is 2014 52 that's the reason its not showing you result.

If you have data you will get proper result.

2) you can create a variable vmaxWeek =if(len(week(today()))=1,0&week(today()),week(today()))

Now use variables instead of max function i use.

Hope it helped

Regards

ASHFAQ

benjamins
Partner - Creator
Partner - Creator
Author

Absolutely!

Thank you so much!

benjamins
Partner - Creator
Partner - Creator
Author

Sorry to bother once more, but when I implemented this solution in my project I noticed the >=vcurrentWeek-9 does not seem to work (see attached sample).