Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

sinanozdemir
Valued Contributor III

Equivalent of sum() over (partition by) SQL statement in QlikView

Hi all,

I am quite new to QlikView and I have a fairly simple table. What I want to achieve in qlikview load script is to be able to sum Amount over Name column. Essentially, have Overall Total column populated in the load script.

Capture.PNG

Any help is much appreciated.

Thanks

1 Solution

Accepted Solutions
MVP
MVP

Re: Equivalent of sum() over (partition by) SQL statement in QlikView

in load script I think you can

a:

load name, date, amount from yourdbtable;

left join (a) load name, sum(amount) as overall resident a group by name;

4 Replies
MVP
MVP

Re: Equivalent of sum() over (partition by) SQL statement in QlikView

in load script I think you can

a:

load name, date, amount from yourdbtable;

left join (a) load name, sum(amount) as overall resident a group by name;

sinanozdemir
Valued Contributor III

Re: Equivalent of sum() over (partition by) SQL statement in QlikView

Hi Massimo,

Thank you for your feedback.

Are there any other ways to accomplish it such as with rangesum function, or with any other functions?

I like the simplicity in your answer though.

Thank you again.

Employee
Employee

Re: Equivalent of sum() over (partition by) SQL statement in QlikView

If your ODBC (or OLEDB) driver supports this SQL syntax, you can write the SELECT just as you have done. QlikView's internal syntax (Load statements) does not allow this type of syntax, so you need to do it in two steps as maxgro suggests.

HIC

sinanozdemir
Valued Contributor III

Re: Equivalent of sum() over (partition by) SQL statement in QlikView

Thank you so much Henric.

Community Browser