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

How to keep a field from changing during the week

I have a source system that I pull data from daily. On Monday morning, I get my planned production for the week for all the manufacturing lines in our company. However, these are changed daily. So the value I have on Monday will be different than the value on Tuesday and the value on Wednesday.

However, I want to show a field in my chart  that has the Monday morning value and another field in my chart for the value that gets changed daily. See the picture below. It helps explain what I'm looking for...

7 Replies
marcus_sommer

You need to store these data, mayby with an approach like this:

t1:

Load *, 'daily' as status From x;

if weekday(today()) = 0 then

     store t1 as DataFromMonday.qvd (qvd);

if weekday(today()) > 0 then

     concatenate (t1)

     Load *, 'Monday' as status From DataFromMonday.qvd (qvd);

end if

- Marcus

mrooney
Contributor III
Contributor III

Perhaps it would be easier to include a flag in your load:

Table:

Load

     .........

     Day(Today()) as #DayFlag,

     ......

From ......;

and use this flag in your chart.

Not applicable
Author

what does this exactly do?

mrooney
Contributor III
Contributor III

Well you should use a set expression like this:

Table:

Load

     .........

     Day(Today()) as #DayFlag,

     FieldToAcum,

     ......

From ......;

In your chart expression:

Sum({$<DayFlag = {0}>} FileldToAcum).

This will take into account just the values of DayFlaf equal to zero (Moday).

Not applicable
Author

Load

     .........

     Day(Today()) as #DayFlag,

     FieldToAcum,

     ......

From ......;

How does above know that it is Monday? This report will be refreshed daily...

marcus_sommer

Will be your file overwritten every day you will need a logic to store these data - have a look on the example above.

- Marcus

Not applicable
Author

Yes it will be overwritten daily....