Filter View on Year value of Date - lotus-domino

I have a view that so far works okay but now I need to add a column that shows the year the document was created and filter to only show documents created after the year 2011 (2012 on-wards). The view is created with the formula of;
SELECT ApplicationAcceptanceDate = ""
The column I am trying to filter on (Created Year) has the format of dd/mm/yyyy hh:mm:ss and I am using #Year to show all the document years value only which works so far. But how do I use the #year formula to filter the year to 2012 on-wards please? Here is an image of the view, its fields and the formula I have tried so far.

Use #ToTime() to convert a field to a date-time value no matter if it is stored in document as a string or a date-time value.
Extend your selection formula to
SELECT ApplicationAcceptanceDate = "" & #Year(#ToTime(CreatedOn)) > 2011
Show the year of creation in column "Created Year" with formula
#Year(#ToTime(CreatedOn))
Remember that you can filter a view only with selection formula, not with column formulas.
Alternatively, you can use #Created. It returns the date-time when the document was created. Your selection formula would be
SELECT ApplicationAcceptanceDate = "" & #Year(#Created) > 2011
then and the column formula
#Year(#Created)

Is the field CreatedOn a text field or a DateTime field? My guess is that it was created as a text field. Even if you change it in the form now, any existing documents will still have the value stored as text.
You need to convert the field on all documents to DateTime, either write an agent to do it or use a tool like NoteMan to quickly change the field type.
You could also use #Year(#TextToTime(CreatedOn)), or (if you have text and datetime fields in different documents) #Year(#TextToTime(#text(CreatedOn)))

The image shows that you are editing the Column Formula for the Created Year column. Click into the white space of the view to make sure you are editing the View Selection formula. Then use:
SELECT ApplicationAcceptanceDate = "" & #Year(CreatedOn) > 2011

Related

Power BI Query Editor - Filter dates in Dataset based on external input (Excel)

I have a large dataset, with a Date column which goes into past dates and future dates.
I have an Excel table with a specific date (e.g. 01/05/2022). I want to filter out the rows which are in the past vs the input given (01/05/2022) by Excel. In the Power BI Query Editor.
I have only found a way on how to filter by current's date...
Thank you very much,
In Excel, name the input date's cell (Range), such as 'ThruDate' (No spaces, special characters, etc).
From the Data Menu, use 'From Table/Range' to send it into PQ Editor.
In PQ Editor ThruDate query, change Column1 Type to DATE, and Rename the Column 'Date'
In your dataset query, manually filter the date column.
Here's the trick! Edit the code that that step created in the Formula Bar or Advanced Editor.
Replace #date(2022, 1, 5) with ThruDate[Date]{0}
Now, each time you change the Input Date in Range("ThruDate") and Refresh, you'll see only the dates after the input date.

Dynamic column selection in Excel

I have a table in excel with months as columns and couple of rows with data. I would like to add a column on the end of the table that will populate with data from the table as the YTD sum of the month columns. The YTD sum will be based on dynamic selection of the month selected from a list. Have a look at the attached image to see what I mean please, in the example Aug-16 has been selected in column P and the YTD total is returned correctly for this period (this is what I want to happen, but not sure how to?:
enter image description here
The dynamic selector I can do fine (Data validation -> list) but I'm not sure how to populate the column with the correct data, that is YTD for the month selected in the dynamic column added. Not sure if it can be done with MATCH, INDEX etc? I tried, also VLOOKUP, but not working....
One solution is to use this formula using the same parameters as your example image.
=SUM(C3:OFFSET(C3,0,MATCH($P$2,$C$2:$N$2,0)-1))

Sort Gregorian date in Power BI

In power bi, I have a date table containing gregorian date and solar date since 1970. how I can sort the solar month? or how can I sort slider containing alphabetic other than English?
If you wants your Month name to order in the slicer alphabetically (like first A then B.... finally Z), rather than using Month value, you can create a Custom column in your Date table with Month name for each date.
Once you created the new Custom column in the source, change the type to Text/General. Now create your Month slicer using this new Custom column. This will now show the month names using alphabetic order.
You can use both DAX and Power Query to get the month name from a Date value.
DAX: MonthName = FORMAT([Date],"mmmm")
M/Power Query: MonthName = Date.MonthName(date_column_name, "en-US")
Finally convert the data type as Text/General.
Process of creating new custom column
Right click on the Date table and select New Custom Column as shown in the below image-
Now put the DAX code and change the data type as shown in the below image-

crystal reports - datetime group header does not show time, only date. need to display date AND time

I have a crystal report that has a group that references a DATETIME column generated by a SQL Server stored procedure.
When I right-click and Format the Group, the Format Editor displays a sample of the field's output, like so:
Monday, March 01, 1999 1:23:45PM
However, when I preview the report, it only shows as such:
Monday, March 01, 1999
I need it to display/sort by the time, as well. Once again, the DB column it points to is of type DATETIME.
I am running CR 11.5 and SQL Server 2008R2.
Any help would be appreciated.
You may want to rethink grouping on a datetime field if you want it distinct down to the second; the chance that multiple records share the exact same datetime field are usually extremely low, negating the usefulness of grouping.
For this reason, CR may have taken the liberty of assuming you only wanted to group by the date instead of the full datetime value. You can check by performing the following steps: Select "Report" from the CR toolbar → "Group Expert" → Select your group on the right and hit "Options" → At the bottom of the "Common" tab there will be a dropdown labeled "The section will be printed". Verify that it says "For each second" instead of "For each day" or some other value.
It's from here that you can control how small or large of a net you want CR to group for your datetime values.

Adding a Date Range

I have an Adobe time sheet where I need to populate all of the date fields based on a beginning date.
For instance if I enter 08-01-11 I need the end date to automatically add 28 days.
Then below, I need all the date fields in the column to list 08-01-11, 08-02-11, etc. The first and last entry should equal the start date and end date.
I have researched for the last few hours but I am unable to find a solution.
Any help would be greatly appreciated.
Thanks.
Tom M.
I did a quick experiment. (I used 7 dates instead of 28 to reduce repetitive work.)
First I created a simple document in Word with a table and some static text labeling the different fields and leaving room for the text fields.
Next, I print to PDF and open the PDF in Acrobat. Here I add 9 text fields. 2 for the start and end dates and 7 for the consecutive dates. I call them startDate, endDate, date1, ..., date7. I set the format of all fields to Date. I make all fields except startDate read-only.
Next, I go the Calculate tab of the endDate field and enter the following JavaScript code (Custom calculatation script):
var f = this.getField("startDate");
var d = new Date(f.value);
d.setDate(d.getDate()+6);
event.value = util.printd("mm/dd/yyyy", d);
I do something similar for the date1, ..., date7 fields.
You can download the result here:
http://download.tallcomponents.com/timesheet.pdf
Frank Rem, http://www.tallcomponents.com