Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

SQL to QV

How to write in script for a graphic this SQL query :

SELECT Max(Sum(Qté receptionnée)) From table GROUP BY Site;

Thanks 😃

Tags (4)
1 Solution

Accepted Solutions
Highlighted
Specialist
Specialist

Re: SQL to QV

If you want to get the max of sum(Qté receptionnée) among all the sites, the above sql query will not work i guess.

We cant use a aggr function inside another aggr function.

Your SQL query should be something like SELECT Max(B.A) From (SELECT Sum(Qté receptionnée) as A From table GROUP BY Site)B.

And in qlikview you can use it as

Load max(A) as max;

Load sum(Qté receptionnée) as A

          ,Site

Resident table / From filename

Group by Site

View solution in original post

1 Reply
Highlighted
Specialist
Specialist

Re: SQL to QV

If you want to get the max of sum(Qté receptionnée) among all the sites, the above sql query will not work i guess.

We cant use a aggr function inside another aggr function.

Your SQL query should be something like SELECT Max(B.A) From (SELECT Sum(Qté receptionnée) as A From table GROUP BY Site)B.

And in qlikview you can use it as

Load max(A) as max;

Load sum(Qté receptionnée) as A

          ,Site

Resident table / From filename

Group by Site

View solution in original post