Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Future date(s) and variables

Hello all,

Hopefully someone can help me with my problem. I want to make a forcast of some data.

I have: DayNumbers, WeekNumbers, MonthNumbers and YearNumbers in my qvw.

I want to create a forcast for one week ahead (now week 34 so want to see week 35). This works for now, but how do I create this if week 52 OR 53 goes to week 1. How do I set the year number +1 ?

What I did:

Variable: vNextWeek / =Week(Today())+1

Set analysis: sum({$<Categories={'SLA'}, WeekNumber={$(=vNextWeek)}, Afdeling={'Infrastructure System'}, YearNumber={'2015'}>}Gewerkte_Uren)

Thanks for thinking with me.

21 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Maybe you shouldn't translate dates into year/month/week parts. Instead, stay with dates. The next week starts on WeekStart(Today()+7) and ends on WeekEnd(Today()+7). Those can be easily inserted as set analysis constraints.

Peter

sasiparupudi1
Master III
Master III

try

if(Weekyear(today())<year(Today()),year(Today()),Weekyear(today())

Not applicable
Author

Can you please help me where to put it in my set analysis

sasiparupudi1
Master III
Master III

YearNumber={"$(=if(Weekyear(today())<year(Today()),year(Today()),Weekyear(today())")}

Not applicable
Author

Unfortunately, this is not the solution.

sasiparupudi1
Master III
Master III

Hi

you might have to replace today() with  max(yourdate) expression..

btw ,what is the issue?

Sasi

Not applicable
Author

Can you help me because I think this is what I need. I need all values from WeekStart(Today()+X) to WeekEnd(Today()+X) to be calculated as a SUM. So:

Day 1: 5
Day 2: 5
Day 3: 5

Day 4: 0

Day 5: 0
Day 6: 0
Day 7: 0
Total === 15

I've created to variables vWeekStart and vWeekEnd but I am unable to get the set analysis working. I tried: DateStart{">=$(vWeekEnd) <=$(vWeekStart)"}


DateStart is the field where al the dates are in.

Anonymous
Not applicable
Author

HI Bart,

Try as per below post:

Re: display/calculate weeks over years without actual date

its for past 12 weeks,modify as your requirement.

Regards

Neetha

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Off the top of my head, you could try with this as a start:

...[DateStart] = {'>=$(=WeekStart(Today()+7))<=$(=WeekEnd(Today()+7))'}...

Best,

Peter

sasiparupudi1
Master III
Master III

the syntax should be as follows.. you must disregard other date related filed selections like weeknumber and yearnumber if you filter the data on your transaction date

sum({$<Categories={'SLA'}, WeekNumber=, Afdeling={'Infrastructure System'}, YearNumber=,DateStart={">=$(vWeekEnd) <=$(vWeekStart)"}>}Gewerkte_Uren)

hth

Sasi