Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

running complex SQL query in QV

Hi all, I'm new to QlikView and I'm using SQL server DB for data, my question is the following: Can I execute complex SQL query directly in QlickView Script? By the term complex I mean a query containing (Count(), GroupBy, OrderBy, DATEADD() ) ....
Thank you,

Nabil

8 Replies

Re: running complex SQL query in QV

You can execute any valid SQL query you wish.

Not applicable

Re: running complex SQL query in QV

I've a valid one but it always failed in reading it

rajeshvaswani77
Valued Contributor III

Re: running complex SQL query in QV

The correct way would be to read the raw table as it is using select without any where clause or grouping.

At the QlikView script level apply the logic that is there in the Query.

thanks,

Rajesh Vaswani

Not applicable

Re: running complex SQL query in QV

Rajesh Vaswani did you mean to reproduce all the SQL function that are already in the query with the QV functions?


Re: running complex SQL query in QV

Hi,

It should work as bill says.

Can you post your query here to check the issue.

Regards

ASHFAQ

rajeshvaswani77
Valued Contributor III

Re: running complex SQL query in QV

Yes, again depends on your scenario as well as the architecture you have in place.

thanks,

Rajesh Vaswani

Not applicable

Re: running complex SQL query in QV

This is the query ,

select DATEADD(dd, DATEDIFF(DD, 0, X.actual_end_date_time),0),  tile_run_state_id, Count(*) from X
Join X_state  on X.state = X_state.tile_run_state_id

Where X_state.tile_run_state_id = 5

Group by DATEADD(DD, DATEDIFF(DD, 0, X.actual_end_date_time),0), tile_run_state_id

ORDER BY DATEADD(DD, DATEDIFF(DD, 0, X.actual_end_date_time),0) DESC

the query is working normally with SQL server Management Studio but not with QV

rajeshvaswani77
Valued Contributor III

Re: running complex SQL query in QV

times out. As an alternative see if you can give a timeout value while creating the connecting string.

thanks,

Rajesh Vaswani