Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Advanced If:ing

LOAD * INLINE [

date, Value

1, 20

1, 30

2, 10

2, 15

3, 40

3, 11

];

This question is part of a more complex expression but here is a simplified version of where it fails:



sum(if(date = max(date), value) => null

is there some other way to accomplish the same?

5 Replies
Not applicable
Author

LOAD * INLINE [

date, Value

1, 20

1, 30

2, 10

2, 15

3, 40

3, 11

]



WHERE sum(if(date = max(date), value) >=Null();

Not applicable
Author

the expression is used in the app not when loading data. here is just some example data, its just something to test an expression on.

Miguel_Angel_Baeyens

It may be a typo, but there is one parenthesis missed there

sum(if(date = max(date), Value))


Besides, names are case sensitive in QlikView. I'd rather try

sum({< date = {'$(=max(date))'} >} Value)


Hope this helps

Not applicable
Author

I realise My explanation was quite bad.

The expression resides in a chart and has to calculate separatly for each row due to a third field which i did not include here, So there can be No set analysis since they calculate once for the entire chart. so is there any way to write the expression in ifs? (with correct case of course)

Miguel_Angel_Baeyens

If you only want to get the maximumd date, then something like this should work

If(date=max(TOTAL date), Sum(Value))


Hope that helps.