ORACLE APEX 5.0 Hourly/Minute Interactive Report Subscription - oracle-apex

Default Subscription for Interactive Reports in Oracle Apex is Daily, Weekly and Monthly. Can we set it up for hourly/ by minute ?

I'm not in a position to test this, but it appears that hourly (but not "minutely") may be possible, but only via an unsupported route.
Subscription details are held in the APEX table called WWV_FLOW_WORKSHEET_NOTIFY, with the frequency in column NOTIFY_INTERVAL which is defined as VARCHAR2(1 BYTE). There is a constraint WWV_FLOW_WORKSHEET_NOTIFY_CK on this column defined as:
notify_interval in ('H','D','BW','W','M')
So it appears that at some point in the past hourly ('H') and bi-weekly ('BW') were permitted values. Of course, 'BW' is impossible as the column holds only one character.
So you could try updating this value in the table to 'H' and see what happens!

Related

GCP: Get old state of a table

I have a table in GCP (BigQuery) that is overwritten every day with data from an external source. Is there any way to view the state of the table at a point in the past? The following code (from https://cloud.google.com/bigquery/docs/time-travel):
SELECT *
FROM `mydataset.mytable`
FOR SYSTEM_TIME AS OF TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR);
produces results just for the case when the "interval" is younger than the time when the table was last modified.
EDIT: It looks like the maximum time travel window is 7 days.
I used the console since it was easier to manage and view.
In order to view the past state of your BigQuery table, you can hover to PERSONAL HISTORY to display the information of your recent jobs or to PROJECT HISTORY to display the recent jobs in your project.
After overwriting your query, you can notice that it has been executed, and per execution has a Job ID. If you specifically know the Job ID of the past table that you want to view, you can filter it. You can also view the Query job details when you click the 3 vertical dots, and from there you can see the state of the table with its specific timestamp and other essential details.

Strategies to map attributes from multiple dimension tables

I'm trying to tackle a requirement in AAS (Azure Analysis Service) tabular model.
In the underlying data model (specific to a particular application), I've a Sales Fact table which joins with multiple dimension tables (lets call these application specific dimension tables) using usual PK-FK relationships.
These application specific dimension are frozen for any changes in
DWH, at the end of reporting month-year and hence can be considered
to have snapshots for all reporting month-years.
Each of these dimension tables has a corresponding "enterprise"
version which is a Type 2 dimension table. That is, for a dimension
such as Product, the enterprise version of the stores the history of
changes for dimension attributes with usual fields such as valid-from
date (start of the month-year), valid to-date (end of the month date)
and latest indicator ('Y' value for the latest version of a specific
reporting month-year) . An new attribute value means a new Product
FK.
Both versions of these dimension tables and the Sales fact would be part of the AAS tabular model.
Now, as part of the reporting requirement I need to build a report (over this tabular model) running for a particular reporting month-year and show Sales data along with specific dimension attribute for the month-year.
Additionally, the report needs to show the data of these dimension attributes from the "enterprise version" of the dimension tables as well, with the latest values (Latest indicator='Y').
For example
Considering just one set of dimension tables
Product-App (Product Name, Product Group, Product PK .... so on)
Product-Enterpise (Product Name, Product Group, Valid-From, Valid-To, Latest Indicator ... so on)
and the Sales Fact :-
**if the user is running the report for Nov-2021 and running this in Jan-2022, the report needs to show Nov Sales data with
Product attributes from Product-App and
Latest values of the Product attributes from Product-Enterprise
That is; for point 2 requirement, the tabular model needs to provide a way for the user to bring the latest values of the Product dimension attributes from Product-Enterprise.**
My understanding is: such capability would mean that to bring the latest values of specific dimension attribute in this scenario/data model, a calculated column or measure approach would need to be taken. Either a calculated column: to map and get the latest values of dim attributes in application-specific dimension or a measure. These calculated columns and measure would then can be consumed from the model for reporting.
I'm looking to any pointers if this is the best approach or are there any alternate approaches can be taken to best address such a requirement.
Thanks!

Error on setting Automatic Timezone in Oracle Apex

I make comparisons of the dates in my data (saved as "due dates" in my data table, as date data type ,without time) with current_date in many pages in my oracle apex application. For example I have one page where I show the "items due for today" in an interactive report by checking the due date of records for their equivalence with current_date, and similarly another page shows the items post due date. The SQL queries generate correct reports but the problem is that current date is calculated as per US (PDT/UCT7) time which is -9 hrs behind from my current region's time, therefore my pages show correct result on afternoon only.
I researched and discovered that setting the application timezone to automatic in application's globalization properties will solve this problem but when I do set the automatic timezone, my application stops working at all and . A "Set time zone" page shows for microsecond but without even letting the user set timezone, page redirects and shows the below error.
Any suggestion to fix this really serious issue will be highly appreciated :(
You mention that your dates are stored in a table of type DATE. Setting "Automatic Timezone" in your application will not change anything. It sets the database session time zone, which is used for columns of datatype "TIMESTAMP WITH LOCAL TIME ZONE". The datatype "DATE" does not know about time zones.
To ensure that your users see the same information is every region around the world, you should store your date information in a column of datatype "TIMESTAMP WITH LOCAL TIME ZONE". The "timezone sensitive" equivalent of SYSDATE is CURRENT_TIMESTAMP.
Joel Kallman wrote a blog about this a long time ago, describing this scenario.
https://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html

How can I get a mapped value from a many-to-one related table via Power BI DirectQuery?

I have 2 tables that share a Foreign Key. Power BI sees them as a Many (Table A) to One (Table B) relationship. All I'm trying to do is to get a value from Table B to show up as a column for Table A.
When I look at the table via PowerQuery (using "Edit Query" in Power Bi Desktop) I can see Table B but every row just shows "Value" as it's value. If I click "Value" I get the details of the related object below the table so I know the relationship works.
My struggle is that none of the methods I've seen via google results to get that value work for me.
I've tried using LOOKUPVALUE and RELATED.
RELATED(TableB[ColumnNameImTryingToRetrieve])
RELATED(TableB[IdColumn]
For the RELATED function, every variation I try for the ColumnName parameter either results in the error message
"The column 'TableB[NameIveGiven]' either doesn't exist or doesn't
have a relationship to any table available in the current context."
or the error message
"Parameter is not the correct type".
LOOKUPVALUE isn't even available as an option in the Intellisense options that come up so i can't try it.
I've seen a lot of references about LOOKUPVALUE not being available in DirectQuery mode and that there used to be an option in DirectQuery options called "Allow unrestricted measures in DirectQuery mode" but that is no longer available. This supposedly would have allowed LOOKUPVALUE to work.
Also, when I make most changes in PowerQuery when trying to add the new column I get the error message "This step results in a query that is not supported in DirectQuery mode".
Is there any simple way to get the value I'm after in DirectQuery mode or should I switch to Import Mode?
Okay, I got what I was after. I used "Merge Queries" in Power Query Editor to do a Left Join on the tables. Then I split the table column up that was created by the Join and left only the column I was after.
Then in a third table, I was able to to do:
RELATED(TableA[TableB.1.ColumnINeed])

Add column with difference in days

i'm trying the new Power BI (Desktop) to create a barchart that shows me the duration in days for the delivery of an order.
I have 2 files. 1 with the delivery data (date, barcode) and another file with the deliverystatusses (date, barcode).
I Created a relation in the powerBI relations tab on the left side to create a relation on barcode. 1 Delivery to many DeliveryStatusses.
Now I want to add a column/measure to calculate the number of days before a package is delivered. I searched a few blogs but with no succes.
The function DATEDIFF is only recognized in a measure, and measures seem to work on table date, not rowdata. So adding a column using the DATEDIFF function doesn't work.
Adding a column using a formula :
Duration = [DeliveryDate] - Delivery[OrderDate]
results in an error that the right side is a list (It seems the relationship isn't in place)?
What am I doing wrong?
You might try doing this in the Query window instead since I think each barcode has just one delivery date and one delivery status. You could merge the two queries into a single table. Then you wouldn't need to worry about the relationships... If on the other hand you can have multiple lines for each delivery in the delivery status table, then you need to get more fancy. If you're only interested in the last status (as opposed to the history of status) you could again use the Query windows to group the data. If you need the full flexibility, you'd probably need to create a Measure that expresses the logic you want.
The RELATED keyword is used to reference another table. Update your query as follows and it should work.
Like this:
Duration = [DeliveryDate] - RELATED(Delivery[OrderDate])