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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardo_dimperio
Specialist II
Specialist II

Max(Date) with Set Analysis

Hi,

I need to get the difference between consume of first and last month from each neighborhood, my problem is that some neighborhood have less months than others, but in set analysis it gets the max (date) of all neighbors and not individual,

ex this two pictures without selection and with selection. How do i do to fix that?

set_analysis.JPG

set_analysis2.JPG

I have this code:

(

(SUM({<DATA_EXTRACAO  = {"$(=DATE(MAX(DATA_EXTRACAO)))"},CONS0={">=0"},GROUP_TYPE_METER={"AGUA"}>} CONS0)-

SUM({<DATA_EXTRACAO  = {"$(=DATE(MIN(DATA_EXTRACAO)))"},CONS0={">=0"},GROUP_TYPE_METER={"AGUA"}>} CONS0))

)

/

If(

SUM({<DATA_EXTRACAO  = {"$(=DATE(MAX(DATA_EXTRACAO)))"},CONS0={">=0"},GROUP_TYPE_METER={"AGUA"}>} CONS0)>0,

SUM({<DATA_EXTRACAO  = {"$(=DATE(MAX(DATA_EXTRACAO)))"},CONS0={">=0"},GROUP_TYPE_METER={"AGUA"}>} CONS0),1

)

Thanks

12 Replies
agigliotti
MVP
MVP

it's very strange, it should works or return 0 but not NULL.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
eduardo_dimperio
Specialist II
Specialist II
Author

I Agree with you

eduardo_dimperio
Specialist II
Specialist II
Author

People, i tried this

(SUM({<DATA_EXTRACAO  = {"$(=AGGR(DATE(MAX(DATA_EXTRACAO)),bairro))"},CONS0={">=0"},GROUP_TYPE_METER={"AGUA"}>} CONS0))

-

(SUM({<DATA_EXTRACAO  = {"$(=AGGR(DATE(MIN(DATA_EXTRACAO)),bairro))"},CONS0={">=0"},GROUP_TYPE_METER={"AGUA"}>} CONS0))

But with this result:

set_analysis.JPG

set_analysis2.JPG