How to select a query as datasource in Apache Superset? - apache-superset

I want to select a saved query as datasource in my charts but Superset only displays views and tables as data sources.
What is required to select a query as a datasource?

In SQL Lab, after you execute the query, you have an option to visualize the query, and then you are able to create a chart using the query, save it, and use it in a Dashboard once saved.
Not very intuitive, I had to look for it too ;-)

IDK if it is still relevant but you can query the dataset. This can be very useful when you're doing nested queries. You can do this with the help of jinja templating. make sure you have enabled them in the config file
select * from {{dataset(233)}}

Related

Create PowerBI Datamart from Azure Analysis Service

I am trying to create PowerBI Datamart from Azure Analyis service. There is a datamodel available in the Azure Analysis Service and I can connect using URL and Database Name. The datamodel has ~100 tables present in it and relationship also setup. So my question is, if I want to create a PowerBI datamart from the Azure Analyis service datamode, I need to do the Get Data option of PowerBI datamart and connect to Azure Analyis service, select table, select fields 100 time for getting all the tables of Azure Analyis service datamode into my PowerBI datamart? Is there any import function available where I can import all the tables in a single time?
Why do you want to copy data from AAS into a database?
The reason you find it difficult is that it's an odd thing to do. The query designer for AAS/SSAS generates MDX queries which are indented to run aggregate queries that return a handful of rows, and are wholly unsuitable for extracting whole tables. If you try, the queries will just run forever and fail.
It's possible to extract data from AAS/SSAS tabular models, but you must use DAX not MDX, and so you need to the Power Query or "Transform Data" window, and use the advanced editor.
Each query to load a table should look like this, eg to load the 'Customer' table:
let
Dax = "evaluate Customer",
Source = AnalysisServices.Database("asazure://southcentralus.asazure.windows.net/myserver", "mydatabase", [Query=Dax])
in
Source

Interactive Grid in oracle apex

How can I handle insert update in Oracle Apex interactive grid with more than one table which is attached with inner join. If anyone have solution please reply.
The source of the IG can be a query or a view on top of multiple tables. Basically this is the rule: if you can execute the update statement in sql on the source then the IG will be able to do it as well.
So it's easy to display some extra columns from another table - updating them will be a challenge. There are 2 workarounds
Create a view with an instead of trigger
Use custom pl/sql code to process the IG data on submit instead of the native process

How to make CTAS and CVAS tables and views created through SQL lab auto-refresh

Context:
I use SQL lab to generate a table for charting but the it often times out when I connect the SQL query result (through explore) to multiple charts in a dash. So I try to use CTAS and CVAS in superset to create a middle layer table for charting to use which loads much faster. But the problem is that it doesn't refresh when new data comes in.
Current solution: I have searched for a week in the internet and found no relevant solution so far.
The Problem:
How to make CTAS and CVAS tables and views created through SQL lab auto-refresh?

programmatically change dataset SQL statement in power bi

Is it possible to change SQL statement of the dataset via API call?
My Scenario: I have data in multiple tables in SQL Server. I have created a SQL query with joins to fetch the required data. I created a SQL server dataset by providing that query in the SQL Statement section and published it on the Power BI workspace. Now, I want to modify that SQL Statment programmatically.
I want to import this same .pbix file to create different datasets. The Idea is to use import date set api to import this dummy dataset and then programmatically change the db source and the SQL Statment, to customizes it for my different report need.
Any pointer or help is much appreciated.
For server name and database name, you can simply use parameters. Click the button to the left of the field to do this. You can make some changes in the query using parameters too, but this isn't very flexible. This can be done by defining text parameter and using it in in the M statement associated with the dataset’s Source step. For more information you may see this article:
https://www.red-gate.com/simple-talk/sql/bi/power-bi-introduction-working-with-parameters-in-power-bi-desktop-part-4/
Then you can use the Rest API to modify parameter values and refresh your datasets. You will need Update Parameters In Group and Refresh Dataset In Group API calls.
At of this writing, this is not supported by the Power BI REST API.
Possible workaround: Given you're using SQL Server, I'd suggest you create a VIEW in SQL Server with the statement you defined in your Power BI report, and change your report to point to that view instead.
Then, to modify the SQL statement, you just have to ALTER the view in the database.

Create a QuickSight dataset from a PostgreSQL materialized view

The AWS QuickSight Documentation mentions that:
You can retrieve data from tables and materialized views in PostgreSQL instances, and from tables in all other database instances.
When creating a dataset from my PostgreSQL 9.5 database, none of my materialized views display in the list to select from.
Is the documentation incorrect? Is there somewhere else I should be selecting from?
I haven't used views as my source. However I can usually see tables only from one schema. Maybe your views are in different schema?
If that is not the case, just use Query instead of Table as source for your dataset and just select * from myview.