Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
AH
Contributor

Exclude negative Values from expression

Hi,

I have the expression to calculate the Units. But i am having some negative Units (Value) which i dont want to include in the calculation.

=num((Sum({<Type = {'AB','CL'},

[Year] = {$(=max([Year]))}, [Month] = {"<=$(=max({<[Year]={$(=max([Year]))}>} [Month]))"}>}[Units])),'##,##0')


How do i do this?

Any help please?


=num((Sum({<Type = {'AB','CL'}, Units -={},

[Year] = {$(=max([Year]))}, [Month] = {"<=$(=max({<[Year]={$(=max([Year]))}>} [Month]))"}>}[Units])),'##,##0')


Thanks,

Ahmed


1 Solution

Accepted Solutions
sinanozdemir
Valued Contributor III

Re: Exclude negative Values from expression

Have you tried using it like the below:

=num((Sum({<Type = {'AB','CL'}, Units ={">0"},

[Year] = {$(=max([Year]))}, [Month] = {"<=$(=max({<[Year]={$(=max([Year]))}>} [Month]))"}>}[Units])),'##,##0')

2 Replies
sinanozdemir
Valued Contributor III

Re: Exclude negative Values from expression

Have you tried using it like the below:

=num((Sum({<Type = {'AB','CL'}, Units ={">0"},

[Year] = {$(=max([Year]))}, [Month] = {"<=$(=max({<[Year]={$(=max([Year]))}>} [Month]))"}>}[Units])),'##,##0')

MVP
MVP

Re: Exclude negative Values from expression

=num((Sum({<Type = {'AB','CL'},

[Year] = {$(=max([Year]))}, [Month] = {"<=$(=max({<[Year]={$(=max([Year]))}>} [Month]))"}>} rangemax(0,[Units]) )),'##,##0')

Community Browser