In my project I need to have ability ti add reports.
Adding a report user can choose date for placing his report. (not created_at)
I save this data in "Date":DataTime - format column(2012-03-24T00:00:00+00:00)
User selects date from datepicker and than i parse it with DateTime.parse(2012-03-24) and than save to DB.
Than user via datepicker selects a month.
How can I correctly perform a query to find all records for perticular month?
Is there any method to find by month?
No. You should calculate margin dates and use :date => range (it will create sql BETWEEN query). For example:
month = params[:month].to_i
date_a = DateTime.new Date.today.year, month, 1
date_b = (date_a >> 1) + 1 # will add a month and a day
Page.all :updated_at => date_a..date_b
Related
I have 3 tables StartDateSelect EndDateSelect and Date.
Date is what is driving my other table in the report.
Note Date3 is formatted as 123ABC to show "Latest" for the latest date after refresh else show Date. This is to make sure that for each scheduled refresh, I will always have the filters show as the latest date so the user doesn't have to switch it each day.
In my dashboard, I have two filters for date selection (start and End). I have selected the dates I want as shown:
I want the Dates table to be filtered for values BETWEEN the selected Start Date and Selected End Date (which in most cases will be stuck on "Latest")
I've played with filters on visuals and index columns with no luck, and I can't seem to get this to work. Or if there's another way to do this. The Between filter won't work with a word called "Latest" in it as it's ABC123 format by default.
Create a measure as follows.
Measure =
VAR cursor = MAX('Date'[Dates])
VAR startDate = MAX(StartDatesSelect[Dates])
VAR endDate = MAX(EndDateSelect[Dates])
RETURN IF(cursor IN DATESBETWEEN('Date'[Dates], startDate, endDate),1,0)
Set a filter on your visual as follows:
That's it.
Every month I download a set of data into a report. That data consists of multiple records and each record has a record specific date as well as having the month end report date on the record's data-row.
I have used Power Query to upload all of these month end reports. I want use Power Query to be able to compare the column of record dates with the earliest date in the column of report dates to see if anybody has fiddled any data entry. The query table has the following headings.
Record ID Record Date Report Date
I've tried adding a custom column using the formula = if Record Date < List.Min(Report Date) then "Old" else "New"
this didn't work and I've spent ages trying to get a solution. I've also tried using Groups to get the minimum value, but I lose all of the other columns, which I want to keep. Any help really appreciated.
You have to refer to the fields in [], so here [Report Date]
To pick a column use Source[Field], so here #"PriorStep"[Report Date]
The List.Min function is not pulling as a number so you cant use <
Insert a Number.From in front of the calculation to convert to number
Same need to add Number.From in front of [Record Date] pulling as a date
Combined code:
#"Added Custom" = Table.AddColumn(#"PriorStep", "Custom", each if Number.From([Record Date])<Number.From(List.Min(#"PriorStep"[Report Date])) then "Old" else "New")
Date picker used in our application has 2 dropdowns in it (list of months and years) in UI. Manual input is disabled for some reason and hence it's getting difficult for us to handle it in jmeter.
Scenario is:
User will select Year first > then month > then date in FROM dropdown and TO dropdown will contain any date (select Year first>then month> then date) which is greater than date selected in FROM but wil be less or equal to today's date.
How can I achieve the same on jmeter? thanks in advance.
Usually, the date value is being send to the server in one parameter, or in three, for example
date = "12/01/2019"
day = 01
month = 12
year = 2019
You need to record your scenario of choosing and submiting a date by using the HTTP(S) Test Script Recorder and to see how it sends in the request.
I have a month column in the data and I am adding this as a filter so that user can filter whichever month he wants.
I want the month filter to be defaulted to current month whenever user opens the report and then he can change the month based on his needs. Is this possible in spotfire?
You can create the calculated column with the following definition and pick current month as a filter.
If(Month([Date])=Month(DateTimeNow()),"Current month",String([Date]))
I am creating a view where i have multiple records showing up for each month.
Example: January is showing 20 records and February is showing 30 records. I only want the last record of EACH MONTH to show up. So i want to see 1 record for each month.
I have already tried the first() and last() table calculation, but it does not filter by month, but by column.
If you just apply first and last on the dataaset then you won't get the correct output, If you need for every month then you need to divide the partition to year and month and then apply the max on the specific partition.
Try this way:
Place the order date in Exact date format and change the property to discrete
Now extract the year and month in separate calculated fields and place in detail.
Year:
year(Date)
Month:
Month(date)
Now create one more calculated field and write below code:
WINDOW_MAX(MAX([Order Date]),FIRST(),LAST())
Try This
1 Calculated Field - DateMonth
Datetrunc('month',Date)
2 Calculative field - LastDate
{ FIXED DateMonth: max(Date)}
3 Calculative Field- Filter
if lastDate=Date then 'Yes' else 'No' end