Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

Applying filters to Simple Reduce (instead of manually selecting fields)

Hi All,

I am hoping this is a simple question, but I cant seem to find a definitive answer on whether or not this can be done.

I am on Qlikview 9, and as part of a Simple Reduce of a document load, I want to set a date filter that selects all dates > 1/1/2011, so that the next file that is triggered off this is only pulling via the newly created binary with only 2011 data going forward.

The problem I am having is that when you go through the simple reduce process, it appears to make you manually choose one by one each specific date, which obviously isnt feasible.  Is there a way to tell the reduce to always reduce via a filter?

Thanks

James

3 Replies
MVP
MVP

Applying filters to Simple Reduce (instead of manually selecting fields)

Hi James,

I'm afraid I'm not getting the issue, but if you mean Publisher tasks, you can use Year field instead and select 2011 value there instead of selecting 365 dates.

Does that suit you?

Miguel

Not applicable

Applying filters to Simple Reduce (instead of manually selecting fields)

That would still require manually changing it when 2012 came...and again when 2013 came, etc... obviously its not a huge issue, but I am wondering if there is a way to tell the reduce to select ">= 2011" every time automatically so that I never have to go in change the reduce statement again.

I am guessing that it is not possible to tell Qlikview to reduce a file based on something like "where Date >= 1/1/2011"

MVP
MVP

Re: Applying filters to Simple Reduce (instead of manually selecting fields)

Hi,

The WHERE clause will work just fine as you have posted it, but when using QVD files, not binary loads. I don't know what kind of load are you doing. You can set a variable in your script so it always takes today's year minus three, for example, so you won't need to change it in the future and it will always load the last three years:

LET vLoadFromYear = Year(Today()) -3;

Invoices:

LOAD *

FROM Invoices.qvd (qvd)

WHERE Year >= $(vLoadFromYear);

Is that what you are looking for?

Miguel

Community Browser