Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

how to write this expression in script

=SUM({<R3={'C'},[Sold To Opt Out Flag]={'N'}>}TOTAL <[Territory Name]> [Monthly Sales]

1 Solution

Accepted Solutions
anbu1984
Not applicable

Re: how to write this expression in script

Load [Territory Name],SUM([Monthly Sales])

Resident Table

Where R3='C' and [Sold To Opt Out Flag]='N'

Group by [Territory Name]

17 Replies
avinashelite
Not applicable

Re: how to write this expression in script

if(R3='C' and [Sold To Opt Out Flag]='N',Aggr(sum([Monthly Sales]),[Territory Name]))

Not applicable

Re: how to write this expression in script

Is it working in script editor

anbu1984
Not applicable

Re: how to write this expression in script

Load [Territory Name],SUM([Monthly Sales])

Resident Table

Where R3='C' and [Sold To Opt Out Flag]='N'

Group by [Territory Name]

avinashelite
Not applicable

Re: how to write this expression in script

if you want  the sum then you need to create a resident load and use the group by function

Not applicable

Re: how to write this expression in script

Thanks for your reply

But the actual expression is

=AGGR(NUM(RANK(SUM({<R6={'C'},[Organization Name]=,[Organization ID]=,[Organization Name|ID]=,[Sold To Opt Out Flag]={'N'}>}[Monthly Sales]), 4, 1)),[Organization Name|ID])

the above is the script i am trying to do in script editor

avinashelite
Not applicable

Re: how to write this expression in script

Hi,

set analysis wont work in the script . Please follow the anbu approach

Not applicable

Re: how to write this expression in script

hi ,how to use rank function in load statement

anbu1984
Not applicable

Re: how to write this expression in script

Temp:

Load [Territory Name],SUM([Monthly Sales]) MonthlySales

Resident Table

Where R3='C' and [Sold To Opt Out Flag]='N'

Group by [Territory Name]

Rank:

Load *,RowNo() As Rank Resident Temp Order by MonthlySales desc

Not applicable

Re: how to write this expression in script

thanks for reply anbu will apply n let u know