Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Weekly chart

I have created a chart that shows the total amount weekly. the problem is that every week the data is replaced with the data of the current week. How would i save the previous data and still show the current data generated within the qlikview chart

8 Replies
Not applicable
Author

is there a way of saving the data on qlikview...

Not applicable
Author

Easy way is to store the date into a table with a name that contains the week. Something like this.


LET CurWeek = Week(Today());
STORE * FROM Table INTO Table_$(CurWeek).qvd (qvd);


Each time the week changes, a new qvd is created. You can use a loop to read all the week-qvds.

Not applicable
Author

thank you for your suggestion i have created the qvd. is there a way to store each week without overwriting the data that is stored

wizardo
Creator III
Creator III

hmmm

i might be mising somthing but....

what you have is a chart

the store to QVD is good for the script but your chart is in the layout

what i dont understand is what you mean by saving the weekly data

you only keep 1WEEK of history in your model?

if yes then the best way is to wright a macro the exports the pivot/straight table into QVD with a name chaning every week

then on the next reload you can load that table and so you will have history of 2weeks in yuor model.

next week do the same and you have 3 weeks in your model and so on

after few week you will have history and you can change the chart to show a week data and a list box with week numbers and dats and you can select which week shows in the chart.

if you have more hisotry then one week then with set analysis you can show two charts, one with current week and one with user selected week

you can also show two columns (current and user selected week)

check the forums, there are many set analysis expression around for every possible way of time ranges

Mansyno

Not applicable
Author

the report is loading data from a file thatget refreshed every week when this is refreshed all the information from the previos week is replaced. what i wanted to do was to create a report that would saves the previous weeks data and compares it with the current.

i believe that what you suggested will work...do you have any example of how this is used or sample code

wizardo
Creator III
Creator III

oh i see,

what you mean is that the data source get refreshed every-week so it only contains records of one week.

in that case you need to do it in the script

the process logic is as following:

load the data from your weekly table

load from QVD and concatenate the history data with the new data

store the data in a qvd file

this repeats on every load, so the QVD will grow each week with the new data added to it.

something like this


ALL_WEEKS_TABLE:
load * from CURRENT_WEEK_TABLE.XLS;
// remark the two lines below on the first time you run this script,
since there is still no QVD file
CONCATENATE
load * from HISTORY_WEEK_TABLE.QVD (QVD);
store ALL_WEEKS_TABLE into HISTORY_WEEK_TABLE.QVD;



you would need to be careful if you are doing a debug reload with less records.

you will need to remark the line with the STORE command before you reload from debug.

other wise your QVD file will be compromised.

Mansyno

Not applicable
Author

thanks for your help it does work...however how do i stop it from adding the data to the previous week each time it loads... will i need to comment out the loads each time...if that is the case is there a simpler way to remedy this

Not applicable
Author

You mean you don't want to concatenate the data?

You can do this by forcing QV to not concatenate. Use the NoConcatenate prefix.