Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting

Hi

I'm pretty new to QV, need help with this statement.

I need Sum of Sales Amount only for Active employees.

Please could you send me the correct script

Sum (([Sales Amount]),where[_Active employee]=1)

Thanks

Chris

1 Solution

Accepted Solutions
PrashantSangle

Hi,

in script

LOAD employee,

      sum([Sales Amount])

where wildmatch([_Active employee],'1')

group by employee

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

10 Replies
PrashantSangle

Hi,

like this,

SUM({<[_Active employee]={'1'}>}[Sales Amount])

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
alexandros17
Partner - Champion III
Partner - Champion III

Load

Employee, Sum (([Sales Amount]) as SalesAmount

resident myTable

where[_Active employee]=1)

Group by Employee

let me know

PrashantSangle

Hi,

in script

LOAD employee,

      sum([Sales Amount])

where wildmatch([_Active employee],'1')

group by employee

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi,

In the script you can use

if([_Active employee]=1,sum([Sales Amount])) as Sales_amount

as use Sales_amount Dimension.

ashwanin
Specialist
Specialist

sum({<Active employee='1'>} Sales)

qlikviewwizard
Master II
Master II

Hi Chris,

Please try this.

Hope this will Helpful to you.

Capture.JPG

Data:

LOAD employee,

      sum([Sales Amount])

where wildmatch([_Active employee],'1')

group by employee;

Not applicable
Author

Thanks, that's perferct

alexandros17
Partner - Champion III
Partner - Champion III

Sorry but I think that the answer you marked as correct doesn't work because there isn't the source table in the query....

qlikviewwizard
Master II
Master II

Hi,

Script is something like this.

Data:

LOAD employee,

      sum([Sales Amount])

      FROM

[QVD\Sales.qvd]

(qvd)

where wildmatch([_Active employee],'1')

group by employee;