Scheduling a report that contains a value prompt with dates - cognos

I have a Cognos report, which contains a prompt page with a Date Valid prompt. This is a value prompt, not a date prompt.
I need to schedule this report so when the schedule is suppose to run, the last day of the previous month from this prompt will be automatically selected.
Right know if I create a schedule and define my prompt values, I select the last day of the previous month. But then the scheduled report always runs with this date which has been set, even when i schedule it to run next month.
I would like the report to automatically selected the last day of the previous month from this value prompt when the report is scheduled (for example I schedule this report to run next month Monday in September and I need it to select 31st of August automatically).
The solution found online includes macro prompt, or creating two values/options for the date prompt - one for scheduling (which will automatically select last available date according to the schedule date) and one for ad-hoc report run (select your desired date from the prompt).
Any help how/where to use the macro prompt would be much apreciated.
Thank you

Step 1) On your main report query create a data item (go to the query, to the tool box and drag query calculation over to you data items)
Name it something like, Target Date
and the expression should be:
add_days(current_date,-1)
Step 2) Add another value prompt with static values of Y and N, name the parameter something like ScheduleDate
Step 3) Change the value prompt for your date, set usage optional
Step 4) For your existing filter based on your existing value prompt
i.e.
[Invoice Date] = ?SomeDate?
Change this filter for your main report query to
(?ScheduleDate? = 'N' and [Invoice Date] = ?SomeDate?) OR
(?ScheduleDate? = 'Y' and [Invoice Date] = [Target Date])
If you ran on Dec 1st, it would use Nov 31st

Related

Power Automate - Compare StartDate to current date?

We are looking to compare the calendar start date with the current date in flow. Currently we are pulling the start date through a filter query like this:
formatDateTime('EventDate','M-d-yyy hh:mm')
and comparing to this:
formatDateTime(addDays(utcNow(),3),'M-d-yyyy hh:mm')
I am getting this error currently: "Unable to process template language expressions in action 'Get_items' inputs at line '1' and column '17987': 'In function 'formatDateTime', the value provided for date time string 'EventDate' was not valid. The datetime string must match ISO 8601 format."
Any help on this would be greatly appreciated!
You could Initialize a variable like the following below and then do a IF condition.
#{add(div(sub(ticks(utcNow()),ticks('1900-01-01')),864000000000),2)}
I test with the same formula to convert event start date and it works fine in my end. The if condition returns correct result on different conditions.
Here is the logic of my demo flow, please have a check:
I use get item to get the start date of a certain event in the calendar list and convert the start time dynamic content to the format I need. Almost same with yours.
According to the error message, it seems the format of the event date column is not in the supported format. Would you like to provide the settings of your event date column? I test with the default start time column and a custom date & time column of default settings. Both of them works fine with the flow above.
Update:
The two formulas used are displayed below:
formatDateTime(outputs('Get_item')?['body/Event_x0020_Date'],'M-d-yyy hh:mm')
formatDateTime(addDays(utcNow(),3),'M-d-yyyy hh:mm')
I just directly use the outputs of the data compose action in the if condition
What worked for me was to build a sequence of numbers with the dates being ordered by day, month and year this way, when converting to integer, it's easy to compare
int(formatDateTime(utcNow()),'yyyyMMdd'))
if you need add day for exemple, you can use
int(formatDateTime(addDays(utcNow(),variables('extraDays')),'yyyyMMdd'))
and the other date like this
int(formatDateTime(variables('FinalDate'),'yyyyMMdd'))
Based on your example, you can put hours and minutes without any problems, just remove the special characters and spaces
but by the definition of the error you are having, I believe it is because of the way you are writing the variable

How to group by mixed values and sort by date in a PivotTable?

I am attempting to create a spreadsheet with a lot of data captured in it. The two requirements I have to meet are 1) group jobs/parts with the same PROJECT #, and 2 sort by JOB START DATE. I thought PivotTables were the best way to do so, but I keep running into a brick wall. I'm either unable to group by Project # (most likely because they are a mixture of numbers and text, this cannot be changed), or I'm unable to sort by Job Start Date.
I've tried moving Project # and Job Start Date from Rows to Values, as well as changing the order they're displayed in (Job Start Date before Project # and vice versa).
If grouped and sorted correctly, the records should show the grouped PROJECT # with the earliest start date first, then the next group with the next start date, etc.
An example would be:
>2074, 68506, BUC10626, 3/4/19
>>2074, 68568, AUC15393, 3/4/19
>>2074, 68570, AUC14509, 5/30/19
>2552, 69920, 99163786, 4/1/19
>>2552, 71066, H695359, 6/5/19
>1166, 71527, 5450926, 5/16/19
>2497, 71138, 2436-923, 6/11/19
>>2497, 73445, H646427, 7/24/19
>2704, 72682, AUC11771, 6/24/19
Pivot tables build a hierarchy. If you have a cascade of Project > Job > Part > Date, then you can only sort by date within the container of the previous level, i.e. Part.
If you have more than one part in the hierarchy, then different dates will show up sorted inside that part, e.g.
ProjectA
JobA
Part A
January 'these rows are
February 'sorted by
March 'date
Part B
August
September
Part C
March
April
If you want the projects sorted by date, then you need to have the date column before the project column.

Excel Help - using IF and WORKDAY functions to generate a due date

I am trying to forumlate an IF statement that will generate a due date by taking a given date and adding business days to that dependent on a value in a separate column.
I started off with:
=IF(E3="Fatal",D3+1,IF(E3="Life Threatening",D3+1,IF(E3="Non-Fatal",D3+3,IF(E2="Non-Life Threatening",D3+3,IF(E3="Non-Susar",D3+5,"")))))
But this does not use the WORKDAY or WORKDAY.INT functions at all and is something I am now needing to add. I have collated a list of bank holidays to add into the new function these are listed - 'Backend Sheet (No Edit)'!C1:C752
Example of the sheet is below, I basically need to have it add 1,3,5 business days to the "query received date" dependent on the value in the "seriousness" column and print the new date into the "first attempt due by date" column
Appreciate any help that can be given!
Put your seriousness in a separate helper table along with the days adjustment. Then use workday to find your attempt date.
=workday([date received], index([helper table adjustment],match([this table seriousness],[helper table seriousness],0)),'Backend Sheet (No Edit)'!C1:C752)

Run informatica load with automatic date increment

I need to create an on demand task to load data for say one month, with date increasing automatically by 1 everytime, till it reaches the month end date.
The data of next date depends on the previous data, so i cant't give the date range and run them altogather. It should load for next date only when previous date data is loaded.
EG: starting from 1 april, it should load dat for 1 april, then automatically increment the date by 1, load data for 2 april, and so on.
Someone please help, how this can be done.
If possible, I would prefer to load data in a single session run, instead of running it multiple times.
You can use a mapping variable to keep track of the current date. Initialize the mapping variable with the beginning date using parameter file. In your mapping set the variable to the next day using the SETVARIABLE function. So, when you rerun the mapping the new value of the date will be used.
However, you have to run the mapping multiple times, which you can do using a shell/batch script.

Issue with date and time value - Lists in Sharepoint

Is there a way to make "date and time" column in SharePoint so it will behave in this way:
-if date that is entered in that column is today, tomorrow that column will be empty.
To explain it a lil' bit better, lets put it this way:
That column is reservation column. User enters the date on which he will stop doing something:
column_1-column_2-column_3-RESERVATION_COLUMN
If today is 01.01.2012, and I will be doing something till 05.01.2012., I will enter "05.01.2012." in RESERVATION_COLUMN". When that day comes, or the day after it (isn't really mather) that column will be empty.
I tried some ways, but I didn't succeed. Any help?
Thanks in advance,
K.
Only way I can think of is using a workflow.
Using workflow -> Wait till day + 1 then Set field value to blank.
also you can create TimerJob, which will be executed one or few times per day.
This timer job will query list items with your parameters, like items, where in the date field is value equals today or less then today. Then TimerJob will iterate and update this field.
Other, more difficult way is to write your own custom datatime field with specific behavior.

Resources