Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Rolling +/- 6 months for NPrinting

Hello Qlik Community!

I need to change a chart to show a rolling +/- 6 month period for use in an NPrinting report.

Two Questions:

1) What's the best way to create a chart for this purpose but then hide it so no one sees it?

2) How do I get the graph to show 6 months forward and backward from the current month regardless of date selections?

I've attached a sample app. Thanks in advance!

Cassandra

1 Solution

Accepted Solutions
AlexOmetis
Partner - Specialist
Partner - Specialist

You could do that in Set Analysis... see attached.

e.g. =Sum({<FISCAL_MONTH_YEAR={">=$(=addmonths(monthstart(today()),-6))<=$(=addmonths(monthend(today()),5))"}>}[ALLOC_HRS])

The main issue with that is that if you select on a different field (e.g. FISCAL_YEAR) that does not overlap with those set modifiers, you end up with nothing in the chart. If you wanted it totally unaffected by other selections you could put it in an alternate state.

View solution in original post

6 Replies
Not applicable

Hi Cassandra,

Try to check attached file.

Idea is following:

1. Create variable vFiscalYearMonth

2. Add trigger on date selection which will set variable. In example it just set max possible date

3. Add calculations which will sum needed value based on variable.

Be aware that in example you have data only for 2015. so when you select any year except 2015 you could have no data for calculations

Hope it will help.

cbaqir
Specialist II
Specialist II
Author

Thanks, but how can we make this work so you don't have to make any date selections?

If a user log on and it's today - March 2015, I would want the chart to automatically see September 2014 - August 2015 (6 months back and 6 months forward).

Note - FY15 starts for us in July 2014 and ends in June 2015 so enough data should be there to reflect the statement above.

Not applicable

You could add extra trigger on open which will set variable by needed date

AlexOmetis
Partner - Specialist
Partner - Specialist

You could do that in Set Analysis... see attached.

e.g. =Sum({<FISCAL_MONTH_YEAR={">=$(=addmonths(monthstart(today()),-6))<=$(=addmonths(monthend(today()),5))"}>}[ALLOC_HRS])

The main issue with that is that if you select on a different field (e.g. FISCAL_YEAR) that does not overlap with those set modifiers, you end up with nothing in the chart. If you wanted it totally unaffected by other selections you could put it in an alternate state.

cbaqir
Specialist II
Specialist II
Author

Thanks, Alex. So as I mentioned, this is for use in a NPrinting report so it should not be affected by any selections. In fact, it should not be visible to anyone in the app itself. The alternate state is a good suggestion. I will give it a shot.

Not applicable

If this is strictly for NPrinting, can you use an NPrinting filter for the report.  You could build a filter based on a field, which sounds like it would be a date field.  There is a very good tutorial that shows how to do this and it is located at How to Report Sales for the Six Months Previous to This One – Customer Feedback for Vizubi

it shows how to build an NPrinting filter with 6 months rolling back