Oracle Apex 22.21 - Chart Page - Bar Type - Datepicker - How to remove X-axis date showing time - oracle-apex

This question is a follow up to another SO question
I want a bar chart to show the amount of orders in a given date or range. Everything works as expected. However, the x-axis date labels shows a date time value. I want this to show as just a date value as MM-DD-YYYY.
x-axis date labels shows a date time value
How can I change the x-axis date labels to show as a date value as MM-DD-YYYY without the time value
Chart Series Page Designer
Chart Series Source SQL Query
select COUNT(ORDER_ID) AS ORDER_COUNT,
TRUNC(ORDER_DATE) AS ORDER_DATE
from ORDERS_LOCAL
where ORDER_DATE between TO_DATE(:P5_DATE_FROM,'YYYY-MM-DD') and TO_DATE(:P5_DATE_TO,'YYYY-MM-DD')
GROUP BY TRUNC(ORDER_DATE)
FYI: The ORDER_DATE column is saved as a DATE type formatted as YYYY-MM-DD. I don't save the time at all.
X-axis Page Designer
I did try changing the X-axis Value -> Format to Date - Short but that didn't change anything.

Apply a format mask to your date column:
select COUNT(ORDER_ID) AS ORDER_COUNT,
TO_CHAR(ORDER_DATE,'MM-DD-YYYY') AS ORDER_DATE
from ORDERS_LOCAL
where ORDER_DATE between TO_DATE(:P5_DATE_FROM,'YYYY-MM-DD') and TO_DATE(:P5_DATE_TO,'YYYY-MM-DD')
GROUP BY TO_CHAR(ORDER_DATE,'MM-DD-YYYY')
Now the trunc is no longer needed since the time portion is cut off from all dates. Note that you might need add a column with TRUNC(ORDER_DATE) anyways to the query and order by that column. Reason is that TO_CHAR(ORDER_DATE,'MM-DD-YYYY') is a string so the order will be alphabetically and not by date.

Related

Dynamic Date Filter

I'm using Dynamic date filter by taking min and max from date table. The Dynamic title is working fine if I press date range in between Slicer.
Problem is, in my slicer I took relative date for 1 year for example: 01-nov 2019 to 31-oct-2020. if i filter any date in between the above dates my dynamic title is going to max of my date table not filter in between dates that I choose.
Example
if my date table have 01-oct-2000 to 01-Dec-2020 then I i choose a range in the slicer the dynamic title is going to max of the date that is "01-Dec-2020" but I need "31-oct-2020".
The current landing page displays 12month of dynamic title and slicer.
In the slicer If I press the date in between range the dynamic title is end date is going to Max of my date table but slicer end date value is different.

Power BI Dax Expression Help - Setting default slicer between dates

Power Bi report uses a date slicer (between) - As a default I want it to set the first date in the slicer as Monday (last week) and the last date as Friday (last week). I dont want this to be a relative date but always must be the previous Mon-Fri. I have a column in my data set that tells me which one is the 'Previous Week' as a text field. I dont know how to use this to set a default slicer value. But i also want to make sure the user can change the slicer dates and it changes as per the user request.
Example today is 01/09/2020
I want my default slicer date as : 24/08/2020 - 28/08/2020
I have two measures which gives me by last week dates:
DefaultSD = MINX( FILTER(Data, [WeeksFilter] = "Previous Week Only"),[Date])
DefaultED = MAXX( FILTER(Data, [WeeksFilter] = "Previous Week Only"),[Date])
I assume this is possible using a DAX expression but dont know how to create this expression to populate these default values.
Please note the data is refreshed up until 01/09/2020 so there is currently data for this week but i dont want this to included in the default slicer on report load
You can't set slicer defaults yet but this can be achieved with relative date filtering.
Select date in the last 1 calendar week:

how to show data based on date slicer but from 2 dates columns

Currently, I have a report that displays a series of data that I can filter on the basis of a "date slicer (type 'between')". This slicer works with as specifi column "i_date" because a date table (m_date[date]) is used for the slicer and the "i_date" (from another table "interv") is linked together (1:n relathions).
In this other table there is another date type column with the last modification date of the row (interv[modified]).
Now, when a period is selected with the date slicer, I'd like to show the data where interv[i_date] OR interv[modified] are inside the selected period.
How can I do that ?
Using a new column with the newest date between interv[i_date] OR interv[modified] is not a solution, because in this case if a row is modified after the period, it will not be shown. (because interv[i_date] < interv[modified])
solved with a second slicer simply

Calculated column based on a disconnected slicer

I'm not sure I've summarised this question correctly, so I'll add a description below of the actual problem.
We have a report that displays data for 'jobs'. These jobs have a few relevant date fields on them such as Created Date, Completed Date and Invoice Date. We currently have 3 slicers on the report that work as expected based on these dates.
Users sometimes use all 3 slicers at the same time and end up with all sorts of useless data. No matter how many times we've told them to reset the filters before changing the date slicers, they keep forgetting to do that.
They also do not want to have 3 separate reports.
We've been tasked with providing them with the following:
Something that lets them select what they want to filter on, with the options only being Created, Completed or Invoiced
A slicer that works based on the option they selected above.
We've tried creating a calculated column that is set to one of those dates based on the option selected in the disconnected slicer, and then adding a slicer that works off that column, but we aren't having any luck. The values in the calculated column are not correct
This is what we've done in attempting to solve the problem:
Create a measure that captures the selected value
SelectedMeasure = SELECTEDVALUE('Date Filter Options'[Name],"Created Date")
Create a calculated column to set the appropriate date value
Please note we're only testing with two out of the three possible values at the moment.
Selected Date Filter = if(jobs[SelectedMeasure] = "Created Date", (jobs[Created Date (DateOnly)]), (jobs[Completed Date (DateOnly)]))
What we're finding is that the Selected Date Filter column does not update with the correct date value, even after we change the slicer and the measure updates as expected.
We're totally stumped - I'm aware we are probably a fair bit away from the correct solution, so any help would be appreciated
Not quite sure how to best present the data model, but here are the relevant fields of the 'jobs' table
jobNumber: string
jobId: guid
CreatedDate: date
CompletedDate: date
InvoicedDate date
The Date Filter Options table just consists of one column with these options:
"Created Date"
"Completed Date"
"Invoiced Date"

Date range filter in clustered column chart

In my Power BI report I have a date slicer and a clustered column chart. In the chart I want to display how much events occurred per hour. For that I have a data table like this:
Date Hour Count
01.01.2019 07:00:00 4
01.01.2019 09:00:00 9
03.01.2019 07:00:00 1
07.01.2019 10:00:00 14
and so on ...
The charts x-axis displays the hour, y-axis the count.
Now I want to be able to filter the chart by date when I change the date range in the slicer. For example when I set the slicer to the range from 04.01.2019 to 10.01.2019, the chart should display the hour histogram only of these 7 days.
Hope you have an idea what I want to do.
Thanks in advance!
EDIT
I've found out why it is not working. The report contains multiple charts, each bound to an own data table. Each table has a date column. The slicer uses one of these date columns, but not the one of the data used by the clustered column chart. Now the date column of the clustered column chart can contain one date multiple times. But the date column which is used by the slicer contains each date only once.
The data table used by the slicer looks like this:
Date some other columns
01.01.2019 ...
02.01.2019 ...
04.01.2019 ...
...
Each date is contained once at the most in contrast to the date column of the first table, where each date can appear more than once. Because of this the slicer works for the one chart but not for the other.
Ok, found the solution and it is very easy. All you have to do is to create a relationship between the date column of table two and the date colum of table one. The slicer uses the date column of table two. If you change the date range now this affects the clustered column chart too.