Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

How about this:

=Week(Now() - 42)

or

=Week(Today() - 42)


Highlighted
Not applicable

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.

Highlighted
Specialist
Specialist

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)

Highlighted
Not applicable

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.

Highlighted

How about this

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


OR


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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted

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

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

Highlighted
Contributor III
Contributor III

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.