Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Anonymous
Not applicable
Author

You can execute any valid SQL query you wish.

Not applicable
Author

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

rajeshvaswani77
Specialist III
Specialist III

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
Author

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


ashfaq_haseeb
Champion III
Champion III

Hi,

It should work as bill says.

Can you post your query here to check the issue.

Regards

ASHFAQ

rajeshvaswani77
Specialist III
Specialist III

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

thanks,

Rajesh Vaswani

Not applicable
Author

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
Specialist III
Specialist III

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

thanks,

Rajesh Vaswani