Adding Previous and Next Month Functionality to Calendar Report - sql

So what I'm trying to do is generate a calendar report in Report Builder based on the start and end dates entered. Based on this, I want to use buttons below the calendar called "Previous Month" and "Next Month" that on-click, will go to the previous or next months' calendar based on the start and end dates entered. I've tried doing this with a sub-report (report calls itself with new parameter values), but after one button click back or forwards, it starts decrementing or incrementing by year instead of month. Is there any way to do this? I'm trying to make this previous month/next month toggle work like that of Micorsoft Outlook's Month View.
Thanks in advance!

According to MSDN, you are using incorrect syntax in your expressions, which makes me wonder how it's even working at all.
Your DateAdd should use the DateInterval enum, and I'm not sure why you even need to use DateSerial, but it should have its hard-coded parameters in double-quotes.
Seems to me that this expression should work for what you need:
=dateadd(DateInterval.Month,-1,Parameters!start_cymd.Value)
But that's assuming, as per your comment, that the users can only choose a full month's data, so the start_cymd parameter will always be the first of the month.
Getting the end date is trickier because different months have different end-dates. Here's an example from the same MSDN page:
=DateSerial(Year(Parameters!start_cymd.Value), Month(Parameters!start_cymd.Value), "1").AddDays(-1)
These should get the start and end date of the previous month. Reverse the math/logic to get the next month.

Related

QlikView Dynamic Date Comparisons

I’m relatively new to Qlikview and have a dataset that shows metrics by date.
This data spans two years and the requirement is to have a comparison/variance that is dynamic and can handle the date filters on the report.
For example if the user selects 2018 this field should show the current date compared to the previous year date. Similar for Quarters, months, weeks and weekdays.
Ideally it should always show for the previous period. They’ve had this created in Excel but it can’t handle the amount of records and I suggested QlikView as I had created some other Dashboards in it.
I have tried set analysis though I struggle to see how that would fit into one expression.
Any thoughts would be appreciated!
I would say you would need two expressions, one without a set analysis (that would be filtered by your current selection) and one with a set analysis to guarantee that you only get today's value. This would be something like :
Sum($<[Date Field] = {"$(=Date(Today(), 'DD/MM/YYYY'))}>} [Value Field])
Check the date format conversion to see if it matches the date format of your field.

Date aging calculator

I am trying to create two fields in Microsoft Word. One that has a "created Date" (that I can manually enter) and the second that calculates the difference in days from created date to today's current day. It is to allow me to see how long an item has been worked on as I am using trying to build a schedule in word.
I am assuming a Macro needs to be created but I can't find any clear examples anywhere.
Thanks for your help

Crystal Report using between but only 1 parameter is showing when Entering date values

I have a formula in crystal reports that uses a year period to select its date range.
I want to edit it to bring back a range rather than just a single period.
However it is not giving me the option when entering values to give two parameters.
Current Code:
{PDP_ACC_PERIODS__.ACC_PERIOD} in {?ACC_PERIOD} to {?ACC_PERIOD}
But there is only one box to enter this, not two (as in from and too).
Added an identical parameter called ACC_PERIOD2 that looks at the same field, then added it in the selection expert as.
ACC_PERIOD
is between {?ACC_PERIOD}
{?ACC_PERIOD2}

QlikView: How to set a selection for PDF reports?

Situation:
I have some sheets in my QVW and two alternate selection states:
1. Standard (for selection of an arbitrary date in the reports)
2. PreviousDayFix (for sheets that shall display the data of the previous day only)
For 1.) the user can select the filters and for 2.) the fields are set by document triggers (on open document) and the filters are not displayed for the user, so he cannot change them.
Problem:
I have a report based on one of the "previous day sheets". When I distribute this report as PDF via E-Mail, it seems, that the document triggers are not executed. So the "previous day" will not be set correctly. So when someone opens the Document on 20th Jan, the date is set to 19th Jan. If he doesn't open it on 21st Jan, then the PDF report will stick on the 19th Jan.
I've seen, that you can select one of the following options in the report settings:
Current selection
Clear selection
Bookmark
But there seems to be no option: "use whatever the document triggers set".
How can I fix / workaround this?
Ok - I did not found an option in qlikview, but a very clean workaround.
Add a field to your calender IsYesterday with if(Date = today()-1, 1, 0)
Don't set the Day, Month, Year fields with the document trigger, but set the IsYesterday field to 1
Make sure, you ran the script at least once
Then it doesn't matter, if the PDF report distribution executes the trigger or not, because the filter stays the same. And since the data is reloaded, the IsYesterday-filter automatically adjusts to the correct date.
Because my question is not only valid for Dates, this answer is not only valid for dates, too.
Basically the trick is, to use a field, where you programatically implement the filter condition and return a boolean. Then you select that boolean (manually or with a document trigger) and save the QVW. Next time, the PDF report generates, the filter is applied.

Save a calculated result in a table using a query (Access 2007)?

I have a form of multiple project sites where one of the fields is labelled "Project Start Date". I have another field in the form labelled "Projected Project Finish Date". Both fields are stored in a table labelled "General Project Info" (well, at least that's the source of the information for the form come from).
I could manually fill in the Proposed Project Finish Date by adding 10 days to the Project Start Date, but I would like to make it a calculated field, i.e once someone puts in the Project Start Date Access automatically calculates the Proposed Project Finished Date.
I am aware you can use a query to calculate this: New Query-->Include Project ID and Project Start Date fields, then make the third field--> Proposed Finish Date: DateAdd("d",10,[Project Start Date]). This produces a query result which has a column with all the sites, a column with the Project Start Date and a column with a date that is 10 days later. Perfect. But, how do I store those new results in my existed General Project Info table and have them appear in the form? I'm obviously a beginner and am missing something.
Thanks for any help in this matter.
Oh, I am using Access 2007.
You can use the After Update event for Project Start Date on your form to update the Project End Date control to Project Start Date + 10, but if the answer is always + 10, why store the date at all? Just use your query to show the end date.
Private Sub StartDate_AfterUpdate()
Me.EndDate = Me.StartDate + 10
End Sub
Or
SELECT StartDate, StartDate + 10 As EndDate FROM ATable
Edit
To add an After Update event, use the property sheet in form design view. Select [Event Procedure] and then click the three little dots. It will open up the code window and you can add code into the event. You will need to use the proper names for you controls, but if you type Me., intellisense will help you along with names of properties, methods and controls.