Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Not applicable

Selecting the last 6 weeks

Hi,

So I have been trying to setup a report where i select the last 6 weeks. So far i have been able to get the last week with the formula:

=week(now()-7) as a filter.

How can i transform this filter into it selecting the last 6 weeks instead of just the last week?

Thanks in advance.

7 Replies

Re: Selecting the last 6 weeks

How about this:

=Week(Now() - 42)

or

=Week(Today() - 42)


Not applicable

Re: Selecting the last 6 weeks

Hi Sunny,

This doesn't work, I just get the week from 6 weeks ago. But I need to select the last 6 weeks instead of just the week 6 weeks ago.

galax_allu
Valued Contributor

Re: Selecting the last 6 weeks

Hi,

you can use set analysis for this ..

If you have week number ...

Sum({$<Weekfield={">=$(=(Max(Weekfield) -6))<=$(=(Max(Weekfield)))"}>}sales )

Provided  Weekfield  is a Week(Datefield)



or

try this....for last 42 days (6 weeks)

=Sum({<DateField = {">=$(=Date(Today()-42,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}>} sales)

Not applicable

Re: Selecting the last 6 weeks

Hi Allu,

Both options are not working for me, maybe im not being clear enough i need this as a filter in N-printing. Or a way to create a filter so that when i run the report in NPrinting it selects the last six weeks minus the week we live in.

Re: Selecting the last 6 weeks

How about this

Sum({<date ={">=max(date)-42" <=max(date)"}>} Sales)


OR


sum({<date={'>=$(=date(weekstart(max(date)-42)))'}>} Sales)

Life is so rich, and we need to respect to the life !!!

Re: Selecting the last 6 weeks

I don't really know how filters in nPrinting work, but can you do something like this?

='>=' & Week(Today() - 42) & '<=' & Week(Today)

beginner91
New Contributor III

Re: Selecting the last 6 weeks

hello all,

i wanted to see all my bar charts within the last 6 months. when i write =week(now()-42) its just show me 1 bar chart and i wanted to see the last 6 bar charts.
Community Browser