Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

New Contributor

Last week calculation

Hi below expression is for last week( if i select wednesday as fromdate it will show last monday-sunday transaction)

SUM({<DateNum={">=$(=(Floor(WeekStart(DayStart((vFromDate),-7))))) <=$(=(Floor(Weekend(DayStart((vFromDate),-7)))))"},_KEY_REFERENCECATEGORY={"0"},Year=,Month=,Date=>} -QTY)

BUT i need,irrespective of date selection it has to show last week(means if i am running on 11/5/2016,it has to show transactions from 4/5/2016 to 10/5/2016)

Can anyone modify it?

1 Reply

Re: Last week calculation

May be this:

Sum({<DateNum={">=$(=(Floor(WeekStart(DayStart(Today(),-7))))) <=$(=(Floor(Weekend(DayStart(Today(),-7)))))"},_KEY_REFERENCECATEGORY={"0"},Year=,Month=,Date=>} -QTY)

Community Browser