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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reduce data in script

Hi,

We have on "master" QVW, in which we have all the data. This QVW takes a lot of memory and thus we do not want to share it. Instead, we split it into two separate file, "sales" file containing sales related data and "production" file containing production related data. All data manipulation is done in the script of the "master" QvW and thus we have a single place to maintain the business logic ("sales" and "production" QVWs have partly overlapping tables).

To improve the performance even more, i would like to reduce both files by dropping off old years. In practice, what I would like to impelemtn in script a logic that would be similar to following in the client: select previous year and current year and then File -> Reduce Data -> Keep Selected -> Save.

I know the Publisher would have this kind on functionality, but we do not have Publisher. Is there any way this can be done in script?

Thanks!

-- Jussi

1 Reply
johnw
Champion III
Champion III

Maybe something like this if you're trying to remove rows already loaded.

INNER JOIN (MyTable)
LOAD year(today())+1-recno() as Year
AUTOGENERATE 2
;

You could also use a WHERE condition to simply never load those rows in the first place. Though if you're loading from a QVD in the first place, I'd create the years first, then load where exists the year. That will keep the load optimized where simply checking the year in the where will not.