Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Max function

Hi Guy's

I am trying to use the max function as per the following. The problem comes in is when one of these values is zero or null then it will not add. Is this normal ? Script below and thank you for your help in advance.

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Unsound with NO VALUE - Sinkers', [Prec of SKR]))

+

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Unsound with NO VALUE - Mould', [Prec of SKR]))

+

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Oil Nuts Value', [Prec of SKR]))

1 Solution

Accepted Solutions
sunny_talwar

May be try this:

RangeSum(

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Unsound with NO VALUE - Sinkers', [Prec of SKR])),

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Unsound with NO VALUE - Mould', [Prec of SKR])),

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Oil Nuts Value', [Prec of SKR])))

View solution in original post

4 Replies
MK_QSL
MVP
MVP

Max(Alt(YourExpression,0)) + Max(Alt(YourExpression,0)) + Max(Alt(YourExpression,0))

But I think something wrong with your expression.

Either you need to use RangeMax(with All your three formulas here) or you are missing Aggr

RangeMax(If([Authorisation Type] = 1 and [Product Style Code] = 'Unsound with NO VALUE - Sinkers', [Prec of SKR]))

,

(If([Authorisation Type] = 1 and [Product Style Code] = 'Unsound with NO VALUE - Mould', [Prec of SKR]))

,

(If([Authorisation Type] = 1 and [Product Style Code] = 'Oil Nuts Value', [Prec of SKR]))

sunny_talwar

May be try this:

RangeSum(

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Unsound with NO VALUE - Sinkers', [Prec of SKR])),

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Unsound with NO VALUE - Mould', [Prec of SKR])),

max(If([Authorisation Type] = 1 and [Product Style Code] = 'Oil Nuts Value', [Prec of SKR])))

Not applicable
Author

Thanks so much , worked perfectly

sunny_talwar

Awesome

I am glad I was able to help.

Best,

Sunny