Qliksense data load editor script aggregation syntax? - qliksense

I'm trying to do a simple aggregation in the Qliksense data load editor. However, this results in an error. Is there a particular Qlik syntax to follow to achieve this?
Load
"var_1",
"var_2",
"var_3",
"agg"
SQL select "var_1", "var_2", "var_3", sum(var_4) as "agg"
from table
groupby "var_1", "var_2", "var_3"

There should be ; between Qlik's Load statement and the SQL statement
Load
"var_1",
"var_2",
"var_3",
"agg"
; // <-- separate Qlik script and SQL
SQL select "var_1", "var_2", "var_3", sum(var_4) as "agg"
from table
groupby "var_1", "var_2", "var_3"

Related

How to execute a update query in spark sql temp tables

I am trying the below code but it is throwing some random error that I am unable to understand:
df.registerTempTable("Temp_table")
spark.sql("Update Temp_table set column_a='1'")
Currently spark sql does not support UPDATE statments. The workaround is to use create a delta lake / iceberg table using your spark dataframe and execute you sql query directly on this table.
For iceberg implementation refer to :
https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-format-iceberg.html

How to fetch Select statement from variable for Copy data activity in Azure Data Factory?

I have source query in Copy data activity of Azure Data Factory. Currently it is static query, but I would like to get entire statement from database and use that in Query in Activity.
I try to pass SQL statement as variable there is issue.
Lookup SQL Query for fetching Select statement:
SELECT [source_query] FROM [SalesLT].[configuration] WHERE [Id] = '1'
Query returns and set variable:
SELECT Count(CustomerId) Source_Rows FROM [SalesLT].[Customer]
Error with Copy data:
Type=System.Data.SqlClient.SqlException,Message=Incorrect syntax near
')'.,Source=.Net SqlClient Data
You can't directly use the pipeline parameter in Query instead need to use #concat function to concatenate your SQL Query with parameters. Please refer the example below:
I suggest you to please go through this tutorial from #TechBrothersIT to get more clarification on the related issue.

Simple Select query is running more than 5hours db2

We have a select query as below . Query to fetch the data is running more than 5 hours.
select ColumnA,
ColumnB,
ColumnC,
ColumnD,
ColumnE
from Table
where CodeN <> 'Z'
Is there any way we can collect stats or any other way to improve performance .. ?
And in DB2 do we have any table where we can check whether collect stats are collected on the below table..
The RUNSTATS command collects table & indexes statistics. Note, that this is a Db2 command and not an SQL statement, so you may either run it with Db2 Command Line Processor (CLP) or using relational interface with a special Stored Procedure, which is able to run such commands:
RUNSTATS command using the ADMIN_CMD procedure.
Statistics is stored in the SYSSTAT schema views. Refer to Road map to the catalog views - Table 2. Road map to the updatable catalog views.
How many rows exist in table?
and not equal operator '<>' not indexable predicates

Foreign Data Wrapper elasticsearch postgresql

I tried to perform postgresql and Elasticsearch together using Foreign Data Wrapper. I have followed this : https://github.com/Mikulas/pg-es-fdw
When I insert new articles, everything is working but when I try to update or delete, it show me some errors :
ERROR: Cannot transform anything else than mappings andsequences to rows
État SQL :XX000
Contexte : SQL statement "DELETE FROM articles_es a WHERE a.id = OLD.id"
PL/pgSQL function delete_article() line 3 at SQL statement
Anyone could help me?
Thanks!

How to fetch column names of a table using HQL and populate in a list?

I want to fetch column names of a table using HQL and populate the same in a list?..Please guide. I am using IBM DB2 database.
I have not tested, but you can query the DB2 catalog in order to get the metadata. If you execute the equivalent in HQL, it should work
select colname
from syscat.columns
where tabschema like 'MYSCHEMA%' and tabname = 'MYTABLE'
order by colno