How to create a report subscription in SSRS which passes today's date to paramters? - ssrs-2016

I created a report with a StartDate and EndDate parameter. If I want to see the information for a single day, I use the same Date in both parameters. I now want to create a subscription for this report so that it runs everyday. How can I use the current date and pass it to these parameters when the report runs? Thanks!

Step 1: You will have your defaultDates dataset as so. can be query or you can wrap it as a Stored proc.
Select TodaysDate = cast(getdate() as date)
Step 2: then , under default values for both the params you will anchor get value from dataset and point to this dataset, which is defaultDates.
Step 3: test it locally. Make sure to delete .DATA from your working directory to enforce fresh data.
Step 4: build and deploy to whatever test location.

EDIT: This will only work with Enterprise edition.
First, write a query that gets the current date and formats it to match the VALUE in your parameter (for example, is it DD-MM-YYYY, YYYY-MM-DD?). Make sure to name your column something meaningful like "CurrentDate".
select cast(current_timestamp as date) as CurrentDate
Then create a new subscription for your report. Instead of Standard Subscription, choose data driven subscription. Now select your SQL datasource and paste in your query. Press validate to make sure it runs fine. Hit OK.
Now you can go down to your subscription parameters at the very bottom of the page. Set Source of Value to be "Get value from dataset" then pick your "CurrentDate" from the drop down.
That's it, data driven subscription with current date.

Related

can some one help me create a Power Automate flow

A power automate flow triggered on a daily schedule will check the list for any tickets that meet (or exceed) due date and submit a ticket to Orion via email. The last run and due date will then be updated. The system may be used to trigger tickets in supplier interface in the future - the destination system should be considered in the list schema.
i am having a hard time to develop a flow that executes the above requirement.
In Power Automate, create a scheduled flow that runs every day.
Declare all variables you will need later.
Assuming you store the value of the last run timestamp in a configuration SharePoint list for example, search and use the action Get item to get the list item where the last run time is stored in this list (you're have to create it if not existing though).
Search and use the function utcNow() in an expression to get the current datetime value.
Convert the previous datetime value with the action Convert time zone to an ISO-8601 datetime using FormatDateTime() function according to your timezone.
Search and use the action Get list items to get all the items of day from your SharePoint list, and filter the query via an OData expression according to the rule (today's date =< last run date + frequency).
Search and use Send an email V2 to send email.
Search and use the action Update item to update the last run time that is stored in a list item in the configuration list mentionned at the beginning.

How to get Start Date of current iteration of Azure DevOps?

I would like to do a query on Azure Devops considering the condition:
work item = Task and
created date < ["Start date of #CurrentIteration"] and
iteration path = #CurrentIteration
How can I perform this contintion (["Start date of #CurrentIteration"]) on Azure Devops?
How can I perform this contintion (["Start date of
#CurrentIteration"]) on Azure Devops?
As I know there's no predefined macros that represents the start date of #CurrentIteration. We have to go Sprints tab manually to get the start date of current Iteration and then use that value in Query.
You can check this document for more details: To list work items based on when they were created, closed, resolved, or changed state—use #Today or specify dates. For queries that list work items based on their assignment to a team's current sprint, use #CurrentIteration.
For now we don't have such macros like #StartOfCurrentIteration. But it would be better if we have one macros used to represent the start date of #CurrentIteration. So I suggest you can post one feature request(Suggest a feature) of this macros in our User Voice forum-Developer Community Forum.
Thank you for helping us build a better Azure DevOps. Hope my answer makes some help:)

How to loop through all line items of a sales order and get the earliest term start date

We are building out the ARM module of Netsuite and our director of Accounting would like the Contract Start date on the header level to be populated with the earliest Term Start date from the line items on the sales order.
I'm just starting this project and am new to Suite Script. I'm hoping to get pointed in the right direction and work f rom there.
To filter earliest date from lines, you first need to fetch all the dates which can be done using record.getSublistValue which requires a set of parameters which you can find here. Once you have filtered out the date, you can set it on body field using record.setValue and you can find its documentation here.
To get the record, it depends on which script-type you are working on, like if you are sripting in User-Event, you will receive newRecord in its script parameter. Whereas if you are working on some scheduled/map-reduce script, you might have to load the record using record.load from N/record module.
You can also do this in the UI without SuiteScript.
Create a saved search with results as Term Start Date with a summary of Minimum.
Add any criteria that you may need (such as Term Start Date is not empty)
Add a filter of Internal Id.
Create the custom field, and under Validation and Defaulting select the previously created saved search. Make sure that stored value is checked off for the custom field!
Look into the article "Creating Custom Fields with Values Derived from Summary Search Results" in the help center for more information!

Data import from new reports and automatically update existing records in existing data

I seek expert advice of all of you in accomplishing my work related task.
Task : Task it to perform Analysis on reports obtained to WorkSafe Monthly and weekly and getting valuable information out.
For example :
Number of injuries on monthly basis drilled down by department and divisions.
Total days lost in year
Count of type of claims
Possible return date.
So i receive these reports and i add some modified columns to it. Like Correct employee names and their ID's just to create a relationship between Employee database in Powerpivot so that i could get their position, dept and division.
Now every month in new report there could be 2 or 3 new claims added to it, and some existing claims with updates info. like Updated return to work date, Short term disability days etc.
Currently i go through them manually and it's really time consuming and tiring. if there there was older claims weren't getting updates i could've just imported from a folder using power query and added steps to remove duplicates. However, if i remove duplicate claims using powerquery now, basically i'll be removing same claims with updated info.
Could anyone you here suggest an efficient way to do it with power query or with other approach?
Thanks in Advance. I'd appreciate your time and effort.
If you use PowerQuery and select your source From File -> From Folder, when you choose to combine and edit you will get a table with its first column named Source.Name; which you could use to differentiate the updates.
For instance: If I start with two excel files in the same folder (theoretically, they could be different date source files for you)...
WS1.xlsx:
WS1 - Copy.xlsx:
Then I use the folder they are both in as the source...
(Navigate to your folder as appropriate.)
...and select Combine & Edit...
...and select the worksheet...
Then I get this:
...and it is clear what information came from what source file.

Optional Prompt in Cognos 8.3

I'm new to Cognos report studio. I have data organized in query items per business date. The Cognos report shows a data filter by business date. For business date there is a separate table join. This is always one column, one row table with current business date. The Cognos report is scheduled to run everyday after data is populated in the data source. This part works just fine.
However, I want to have ability to run this same report on demand and when I run this report on demand it should prompt me for a date instead of picking it from the database table. I know how to add a prompt but when I add a prompt, my scheduled reports doesn't work! I can't provide any default as it has to be dynamically picking it from the table.
Any pointers would be helpful!
Make the date filter (the one derived from the prompt) optional and set a condition on the other filter to be ignored if the prompt has a value.
This is late but could be helpful for other guys. I suggest this:
- In the metadata, make a prompt macro with a default value of current business date
- In the report, make a date prompt using the parameter defined by prompt macro
- In report schedule, leave the date prompt blank to refresh that everyday
This way your schedule runs with refreshed date and also you can pick for a date while manually running a report.

Resources