Calculate Date Field in SharePoint Online - date

I'm trying to calculate a due date field based on two other fields in a SharePoint Online list: [Created] and [Priority]. [Created] is auto-populated when the user creates the new list item. Easy enough. The user selects a [Priority] (Critical, High, Medium, Low). My formula always results in an error due to the pre-populated date field. Surely there's a way around this that I'm just ignorant of. It works fine in Excel, but SP pukes when I try it. TIA!
=IF([Priority]="Critical",[Created]+1,IF([Priority]="High",[Created]+3,IF([Priority]="Medium",[Created]+7,[Created]+14)))

Per my test, it works well in my SharePoint list.
1.Create a choice column named "Priority".
2.Create a calculated column, set "The data type returned from this formula is" as "Date and Time", set "Date and Time Format" as "Date Only".
=IF([Priority]="Critical",[Created]+1,IF([Priority]="High",[Created]+3,IF([Priority]="Medium",[Created]+7,[Created]+14)))
3.Result:

Related

Get full date range of linked field in tableau

Gif of problem
I am currently working on a dashboard in tableau, which shows the count of New-User-Signups and Interactions side-by-side given different date windows. The first New-User-Signup happened before the first Interaction, and the last Interaction happened after the last User Signup.
In order to choose a date window, I linked the date fields in both data sources, and made a date filter, which I applied to all worksheets using related data sources.
However, depending on which "date" field I choose, (from the User Signup table or the Interaction table), the "All Dates" option of the date filter only goes from start to end of that data source's date range.
No matter what I try, I exclude some entries in either one graph or the other. How can I make the "All Dates" filter go from the minimum first date between both data sources, to the maximum last date between the two data sources?
I run into this issue a lot with the data that I use. The problem is that the filter will only be able to contain dates that are in the dataset it is created off of, even if you link the data sources. When I run into this issue, I use parameters instead.
You can find instructions here:
https://kb.tableau.com/articles/howto/creating-a-filter-for-start-and-end-dates-parameters

Crystal Reports - Returning next value in column

Need some help on crystal reports:
We are currently using crystal reports at work to generate confirmation papers to internal counterparties.
These confirmations are automatically triggered by our system when we set the interest rate on a specific deal.
The parameters that are sent from our external system are "deal number" and "action number". This information is passed on from the "events" database table, containing following columns:
The confirmation generated by performing the rate set contains specific information regarding interest payments we expect from counterparties.
So this confirmation generated has unique parameters, being the rateset "action number" and "deal number" from events table (see attached).
Now in this confirmation, we also want to make a reference to the "Next RateSet" date.
We tried to solve this by inserting an SQL statement to:
select top (1) effective date from events table where the
comments=rate set and where the action no = 0
This logic however does not hold up when we have to generate backdated confirmations.
So in theory, I would like to perform a select statement where I select the first record where the "event no" is larger than the "event no" from the current generated confirmation.
I'm not sure how to perform this though, as I've read it's not possible to use a crystal parameter in the SQL selection.
Any suggestions?
One option is to add the table a 2nd time to the report.
Crystal would assign an Alias to the 2nd instance by adding a number to the table name.
To make things more intuitive, change that alias to something like 'NextRateSet'.
Join the Events table to its alias on:
Events.Dealno = NextRateSet.Dealno AND
Events.EffectiveDate < NextRateSet.EffectiveDate
Add record selection criteria of:
NextRateSet.ActionNo = 0
Group the report on Events.DealNo and Sort it Descending by NextRateSet.EffectiveDate.
Suppress the detail section and move everything to the Group Footer.
Since the Group footer shows the last record in the group, it would show the earliest NextRateSet.EffectiveDate. And since that alias is restricted to EffectiveDates following the Events.EffectiveDate, you get the correct date.

Crystal Reports - Dynamic Cascading Parameter based on another parameter

I'm using Crystal Reports 2008 and have a cascading parameter that pulls data from a table that has ~35,000 rows. It creates entries off of 5-6 different columns which can total about 12,000 rows. The values that are returned are not static and change due to re-orgs and such that happen once a month or so (such as some name changes and so forth).
Effective Date, Area, region, state, city, store, employee
Is there a way to pull the corresponding set of 12,000 records based on the period without turning the "table" into a 100,000+ behemoth that would take several minutes to pick parameters?
I would like to have it pick the period the data is for (Effective Date), then pass that value to the stored proc that drives the dynamic cascading parameter.
EDIT:
Here is a sample of what my data looks like
EffectiveDt Area Region State City Store StoreID
5-1-13 Northwest NW-1 OR Bend KMart#1153 1153-42
5-12-13 Northwest NW-1 OR Bend KMart#1124 1124-31
5-11-13 Northwest NW-2 CA Faar Burgerss 8245
6-5-13 Northwest NW-1 OR Bend KMart 1153-42
6-12-13 Southwest SW-4 AZ Hawt Bally 9352
6-17-13 Midwest MW-3 OK Windy Nails 3524-1
So I do not want to have to try to add Effective Date in the complete set. The Effective date sort of drives what is picked and I want to pass that in without including the effective date in the cascading parameter set.
The parameter list the user has to pick from would look like:
Northwest
Southwest
Midwest
Then drive to each lower level from that.
I'm confused on how to base this cascading parameter list without adding another column with the effective date.
Thanks
You can do this by creating a command to retrieve the LOV for the parameter. Add the dates for the period as parameters for this command. When you run the report it will try to run the command and will find that there are parameters for the command. The report will show parameters' dialog for the period, when you set the period it will run the command and show another parameters' dialog to choose the actual report parameters (including the dynamic one). In this dialog the LOV for the dynamic parameter will contain just values within the period set in the first parameters' dialog.
So what you are trying to do is possible but you will get 2 separate prompts for parameters. If you choose wrong period you cannot go back and change it, you will need to cancel the report and run it again.
Another option is to use a viewer, which supports real cascading parameters. The only one I know is demonstrated here: Video. You can add your dates as parameters in the viewer (not necessary to change the report) and the dynamic parameter will be recalculated when dates are changed.

Crystal Reports - Select Current YYMM

I'm trying to create a Crystal Report that reads data from an access table. I have a particular field in the access table called REPT_YYMM. This is basically a run data field, so each month when a program is run it populates the current year/month in the field before exporting to access, so there is a way to do month to month comparisons. For the report I'm working on I just want to display the data along with the current REPT_YYMM field when the data is refreshed on a monthly basis. Is there a way to do this in a formula. I'm not familiar enough with date type functions to know where to start.
Any guidance or suggestions are appreciated!
Your question isn't very clear but if i understood correct you just need to filter the data where field REPT_YYMM = YYMM.
Goto selection formulas, record and enter:
{table.REPT_YYMM} = cStr(currentdate,'yyMM');

How to validate parameter values against a data source in Crystal Reports 2008

I have a report designed in Crystal 2008. The report has a parameter field called "Member ID" that I want to use to get a string input from the user running the report. However, I want to do some sort of validation to ensure that the ID they entered is valid (it exists in a database table that I already have set up). Is there any way to do this?
I know you can set up dynamic parameters that would give the user a dropdown list of Member ID values to choose from based on the data stored in my database table. But I don't want to make the user sort through thousands of IDs in a dropdown. I just want them to manually enter an ID and then have the report check the entered value against a database table.
Is this possible?
You could just create a record selection criteria on your report and pre-limit it to just the valid IDs.
If you are using some stored proc where you pass this parameter and then get the result, then definately you can have a section where you print "no data found" or similar message if recordcount is zero, otherwise you can just display the information for that id.
My experience with crystal reports is that we should have more and more recrod fetching logic on the server then on the client. It will speed up the processing.
Regards
Parminder