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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis

Guys, take a look at follow table:

Tab:

LOAD * Inline [

city, year, exams, surgeries

ny,      2014,      25,      8

nj,      2014,      62,      7

ny,      2015,      81,      9

nj,      2015,      76,      10

ny,      2016,      74,

nj,      2016,      90,

];

If I want the sum of last year's exams with records - 2016 - I can use this dinamic expression:

Sum({< year={$(=Max(year))} >} exams)

Now, the last year's surgeries (also with records) was 2015. The set analysis above wont work.

How can I solve this?

( To do year={2015} ain't the answer. )

1 Solution

Accepted Solutions
Not applicable
Author

Hi!

nice try but....

when I click in 2015, the expression shows me 2014 result.

Another guy in another forum brought this

Sum({< ano={$(=Max({<cirurgias-={''}>}ano))} >} cirurgias)

It was what I needed

View solution in original post

3 Replies
vishsaggi
Champion III
Champion III

Try this?

Sum({< year={$(=Max(year)-1)} >} surgeries)

Not applicable
Author

Hi!

nice try but....

when I click in 2015, the expression shows me 2014 result.

Another guy in another forum brought this

Sum({< ano={$(=Max({<cirurgias-={''}>}ano))} >} cirurgias)

It was what I needed

vishsaggi
Champion III
Champion III

Oh good. Did not understand if that is what you were looking for.

You may also try this?

= Sum({< Year = {$(=Max({< surgeries = {"*"} >}Year))}>}surgeries)