Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis help

Hi

I want to show a line graph of sales for the year.  The 'Sales' field shows actual sales and 'Forecast' shows forecasted sales. I want to show actual sales up to the week before the current week and forecasted sales from the current week until the year end. The forecast is easy as when this reloads it only ever starts from the current week, however actual sales (Sales) has data for a few weeks into the future as there may have been orders placed for delivery. Can someone help me with the set analysis for this, or would an 'IF' statement be better?

Thanks

7 Replies
atafsson
Creator
Creator

Hi,

Please post an example of data.

It might be best with an IF-statement, but it's easier to see if you post a simple example.

Regards

Axel

jvitantonio
Luminary Alumni
Luminary Alumni

Hi,

You can use the following:

= sum({<Date = {'>=$(=YearStart(today()))<=$(=weekstart(today()))'} >} Sales)

JV

kiranmanoharrode
Creator III
Creator III

Dear Adrian,


Please post sample application for better understanding

Regards

Kiran Rode

+91 8976977897

nilesh_gangurde
Partner - Specialist
Partner - Specialist

First Create the Week Field which will give you the week Number from the yearstart.

then you can write the expression like this:

sum( {<Week = {"$(=Max(WEEK) - 1)"} >}  Sales)

hope this will help.

-Nilesh

jerem1234
Specialist II
Specialist II

I agree that an if statement is the way to go: something like:

if(DATE< weekstart(today()),sum(Sales), sum(Forecast))

Like is mentioned previously, a sample qvw would let us help you further.

Hope this helps!

Anonymous
Not applicable
Author

See if the attached helpes

Not applicable
Author

Add 'Background color' and 'Line Style' in 'Sales' Expression.

if(WeekNum < week(today()), rgb(141, 170, 203), rgb(252,115,98))

if(WeekNum < week(today()), '<S1>', '<S2>')