Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Limiting Sales Orders to show on the last two weeks info

Good day All,

Please could you help me with a method to restrict sales Orders tyo show on the last two weeks.

Im using ORDDATE to try do this, I have restricted them to look at last two months before but for weeks it not the same.

(if(MonthIndex >= ( vMaxMonthIndex -1), [Order Quantity Backordered]*[Component Qty]))

is what i used for Months.

Thank you for any assitance you may have.

3 Replies
lironbaram
Honored Contributor II

Re: Limiting Sales Orders to show on the last two weeks info

hi

you can use the function week() which returns the week number in a year ,

then use a similar method to the one you used in month but this method don't support weeks from to different years

your other option is something like

(if(Date >= ( vMaxDate-14), [Order Quantity Backordered]*[Component Qty]))

Not applicable

Re: Limiting Sales Orders to show on the last two weeks info

Hi Liron,

(if(Date >= ( vMaxDate-14), *))

This is looking good, but we have not created vMaxDate – did you create this in variable overview, if so what was your script for that, or how would I word that.

Kind regards

Matthew Raschke

Email: matthew.raschke@ellies.co.za

Tel: +27 11 490 3893

Cell: +27 82 318 5051

www.ellies.co.za <http://www.ellies.co.za> <http:// <http://> www.ellies.co.za/>

94 Eloff Street Ext, Village Deep,

Johannesburg,2001, South Africa.

The only place success comes before work is in the dictionary

P please consider the environment before printing this email

lironbaram
Honored Contributor II

Re: Limiting Sales Orders to show on the last two weeks info

hi

i would create it in variable that holds

=max(Date) , note it important to use the = sign

so the variable will be calculated once in the model

if you don't want to use variable

you can try to use

(if(Date >= ( $(=max(Date))-14), *))

while this is an expression the result will be the same as , the $(=) also calls for calculating the expression at model level , disregarding the chart dimensions

Community Browser