Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with ignoring a field

Is there a way to ignore a field? I had two tables and I joined them into one to be able to do a side by side comparison. For example, I have a two date fields in a table now. One is FutureDate and one is PastDate.

FutureDate (i.e 201440, 201441) is for forecasts in the future for 20 weeks.

PastDate (201340, 201341) is for sales in the past for 2 years back

I used the 'Future Date-100 as PastDate'  in order to be able to do side by side comparison.

But now I need the Sales with its original date ... what is the best way to go about doing this? Changing the way it is modeled in the script or using a set analysis?

All I need is 4 weeks of actual sales from current week and 10 weeks of future forecasts in a graph. So if current week was 201440, I would need actual sales for 201439, 201438, 201437, and 201436 and then I would need forecast for 201440 to 201450 in one graph.

Any suggestions? or advice?

5 Replies
Creator
Creator

One possible solution is to put both sales and forecast in one table with only one date-field.

In your graph you can use something like this to show only the periods you want:

Sales: if(Period >= $(vCurrentWeek)-4 and Period <= $(vCurrentWeek) ,sum(Sales),0)

Forecast: if(Period > $(vCurrentWeek) and Period <= $(vCurrentWeek)+10,sum(Forecast),0)

Please see attached qvw.

Not applicable

Would this work if I set my vCurrentWeek = field in my table?

For example, I have a 'snapshot week' field in my table which is always the current week and it is in the Monday date format....Can I set vCurrentWeek= 'snapshot week'?

Creator
Creator

I think it will work, yes.

If not, you can upload a sample of your data.

Not applicable

Can you see if you can fix this app? The requirement is that need to be able to see 5 weeks of historical forecast from current week and 10 weeks of future forecast from current week. As well as 5 weeks of actual from current week.

If current week = 9/1/2014

I will need historical forecast for weeks: 8/25, 8/18, 8/11, 8/4, 7/28

I will need actual sales for weeks: 8/25, 8/18, 8/11, 8/4, 7/28

and I want to see future forecast for current week: 9/1 and 9/8, 9/15, 9/22, 9/29, so forth until 11/10

Creator
Creator

Is this the result you need ?

135797.png

In your app, I think you're mixing up weeks and dates.

I changed the expression for Sales to:

if([calendar_week]>= vCurrentDate- (5*7) and [calendar_week] <= vCurrentDate ,sum(Sales),0)