Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

selection for last week

Hi experts

I have the following statement giving me entries of the last month:

LOAD *, stunden_1w*stdsatz_alt1W as X_1w;

Load

jobnr,

    stunden as stunden_1w,

    stdsatz_alt as stdsatz_alt1W

resident Stunden where datum > Date(AddMonths(Today(),-1));

How can I get only values from last weeg?

Best

Jan

Tags (1)
1 Solution

Accepted Solutions
yduval75
Contributor III

Re: selection for last week

LOAD *, stunden_1w*stdsatz_alt1W as X_1w;

Load

jobnr,

    stunden as stunden_1w,

    stdsatz_alt as stdsatz_alt1W

resident Stunden where datum > Weekstart(Today(),-1);

6 Replies
yduval75
Contributor III

Re: selection for last week

LOAD *, stunden_1w*stdsatz_alt1W as X_1w;

Load

jobnr,

    stunden as stunden_1w,

    stdsatz_alt as stdsatz_alt1W

resident Stunden where datum > Weekstart(Today(),-1);

mato32188
Contributor III

Re: selection for last week

Hi Jan,

where week(datum) = week(today())-1

BR

M

MVP
MVP

Re: selection for last week

Or, (if you want only last week data)

resident Stunden where datum >= Weekstart(Today(),-1) and datum <Weekstart(Today());

Edit: corrected

yduval75
Contributor III

Re: selection for last week

Indeed, but I think there is perhaps a mistake in your syntax


resident Stunden where datum >= Weekstart(Today(),-1) and datum < Weekstart(Today());

MVP
MVP

Re: selection for last week

Like this, year check will fail.

mato32188
Contributor III

Re: selection for last week

Sorry man, of course, you are right...

Community Browser