How to filter data with a subquery in Cognos Dashboard? - analytics

I need to implement "IN clause" and filter out data from some other query. How can I implement this in Cognos Dashboard.

Related

Filtering a complex status column

I work with a GraphQL (HotChocolate) API that use EF Core to fetch data from my MS SQL Server.
A few entities have status columns, that are currently created on-demand with a complex query which can be translated to SQL with EF Core.
The status is generated with a query of 3-5 tables.
query {
person(where: {status: {eq: Status1}}){
{...}
}
Now I want to make this column filterable with GraphQL, which is currently not possible, because the column is generated in the resolver of the entity.
Is there a good way to filter a computed column with GraphQL or a good solution to store such complex computed columns in the database, which will be updated in a short interval?
I thought to store it in the database and make a CRON Job/SQL Job that updates the value each hour or so, but this solution just doesn't feel right.

Viewing queries coming from outside Snowflake

I am aware of the query_history views associated with account_usage and with the information_schema query_history function family. However, I cannot find a way to monitor what queries are being sent to Snowflake from outside Snowflake. For example, I have Power BI hitting a Snowflake database but queries PBI is sending to Snowflake don't seem to appear in query history. Is this possible to see?
Queries run against Snowflake could be found in Query History view(ACCOUNT_USAGE schema has 45min data latency).
If the external tool(here Power BI) is using dedicated virtual warehouse/user/role then it is easy to filter the records by one of the columns: WAREHOUSE_ID/USER_NAME/ROLE_NAME.
Another option is to use dedicated table-valued function:
select *
from table(information_schema.query_history_by_user(USER_NAME =>'<power_bi_user>'))
order by start_time desc;

Large Postgres data size to handle with google data studio

I have remote access to a distant Postgres Server containing a database which size is almost 50 Go.
Is there any method to work on it with Google Data Studio without downloading the whole 50 Go?
When you use the native PostGres connector in Data Studio, it does not pull all data from the database server. Rather, it will construct separate aggregate queries for each chart element and push down the queries to the database server.
For example, let's assume you have sales data by product and by day in your database. If you draw a chart that shows only current months total sales by product, Data Studio will create a SQL query with WHERE clause that limits dates to current month and also add a GROUP BY clause for the products. Thus, Data Studio will only get back the aggregated results. This will be transparent to the dashboard owner and the viewer.
Keep this in mind while designing your dashboard and make sure to put in filters and aggregations to limit the amount of data you are pulling from the database.

Does SQLAlchemy support Query Notifications of SQL Server?

Does SQLAlchemy support Query Notifications of SQL Server?
If not, what is the closest one could get?
I can imagine I could probably get SQLAlchemy directly submit Trasact SQL queries to set up the query notifications, but is there any more generic way?
In the end what I want is to be informed of any changes to the database that affects my query. This is for a FLASK web server that should then in turn push the updates to the clients showing some calculated information.

Breeze spatial query

We need to run a spatial query and we are also using Breeze, and I understand that Breeze currently does not support spatial queries. So I was wondering if it would be possible to pass a regular query to the controller using the regular Odata format; run the query and then UNION the results with a spatial query run directly against Entity Framework?
In this way, we can have the client prepare a demographic query and do a level one "filter" of the persons we are interested in, and then apply the spatial query to do a level two "filter".
Is this possible? What would the syntax look like?
Thanks!!!!!
Bob
Breeze cannot construct an OData filter on a spatial type but any Breeze WebApi/WebApi2 server can "return" spatial types. So if your query result returns an entity or a projection containing a spatial type, it will be available on the client. ( The client side format is dependent on the JSON.NET formatter).
If this is acceptable, then you can use Breeze's NamedQuery facility to pass extra parameters to your server side query and use these to construct your own spatial filtering.
Hope this makes sense.

Resources