Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Expression for previous weeks' sales calculation

Hello,

I am currently using the following expression to display current and previous 6 weeks' ytd sales figures

=sum({$<WK_NUM= {"<=$(=Selected_Week) >=$(=Selected_Week-6)"}>} sales_ytd)/1000

I need to implement the same logic when calculating wtd sales figures for the current and previous 6 weeks. The way I derive a week-to-date sales figure is (e.g for wk 13): = WK 13 YTD - WK 12 YTD.

Help will be much appreciated.

Thank you!

3 Replies
Not applicable

Re: Expression for previous weeks' sales calculation

Hi,

Expression 1: Current Sales for last 7 weeks (with your expression). Sort the table by week asc.

Expression 2: Previous(Expression 1).

Expression 3: Expression 1 - Expression 2.

Hide expression 1, 2 and uncheck show zero values.

Hope this helps.

Regards,

Kiran.

Not applicable

Re: Expression for previous weeks' sales calculation

Hi Kiran,

Thanks for this but I had no luck. Any other thoughts?

Thanks

swuehl
Not applicable

Expression for previous weeks' sales calculation

Hi,

I must admit I haven't fully understood your requirement, but Kiran's approach might just need to use

above(Expression1)

instead of previous (if you are using a straight table with dimension WK_NUM), I think previous can only be used in the script.

Stefan