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: 
raadwiptec
Creator II
Creator II

previous month data

hi all,

iam using nprinting to deliver the data . I am trying to apply a filter for one of the columns called transaction date. Basically I only need previous months data .

please suggest

9 Replies
prma7799
Master III
Master III

You can use filter like

=date(addmonths(max([Date]), -1), 'MMM')

prma7799
Master III
Master III

Or you can create variable in your qvw file and use it into Nprinting filter.

Stephen_Jasionowski

something like month(now()) -1 should also do the trick

raadwiptec
Creator II
Creator II
Author

it is not getting filtered

Daniel_Jenkins
Specialist III
Specialist III

Hi,

Please post a sample QVW and sample Excel file showing what output you want.

- Daniel.

raadwiptec
Creator II
Creator II
Author

hi Daniel,

Iam using a report with following data

transid ¦ custname ¦ billing date

1              xxx1          12/12/2015

2              xxx2          11/12/2015

3              xxx3          10/12/2015

4              xxx4          09/11/2015

5              xxx5          08/10/2015

My first problem is I have a Year and Month List box. So whenever I open the report fresh. it shows 2016 and chart shows empty as their is no data for 2016. So I want to make it always all data visible

secondly I am calling this report via nprinting. and would like to limit the data only to last month before sending to the user. I tried couple of option with billing date as mont(now() -1 ...et etc but it is not filtering

Daniel_Jenkins
Specialist III
Specialist III

Hi,

Regarding showing all values when the QVW opens I believe you need to un-check the Always one selected value check box in the General tab of the list box properties.

I gather that you have a QVW with a list box and chart like this:

...and you want a report filtered only for billing date falling in the last month like this:

I would:

1. Add a calculated field (YearMonthNum) in the load script like this

T1:
LOAD * INLINE [
transid, custname, billing date
1, xxx1, 12/12/2015
2, xxx2, 11/12/2015
3, xxx3, 10/12/2015
4, xxx4, 09/11/2015
5, xxx5, 08/10/2015
]
;

Transactions:
LOAD *,
Year([billing date]) & num(Month([billing date]),'00') as YearMonthNum
RESIDENT T1;

DROP TABLE T1;

2. In NPrinting use a Field filter defined like this:

I have attached a sample project. Please extract to folder C:\Temp\Community\025 in order to preserve the paths used.

HTH - Daniel.

raadwiptec
Creator II
Creator II
Author

the above is not giving any results..

Daniel_Jenkins
Specialist III
Specialist III

I just checked and it is working fine.

* Did you extract to folder C:\Temp\Community\025?

* Did you check your Default output folder after running the report task?

If it still does not work can you attach the log file (look under File > Options > Log settings to get the location)?

- Daniel.