Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

eduardo_dimperi
Valued Contributor II

Set Analysis - Comparing two dates

Hi,

I'm trying compare two fields and count all meters from same date, but this didnt work:

count({<MES_ANO_EXTRACAO={MES_ANO_VAZAMENTO}>} DISTINCT OID_METER)

Any help please?

Tags (1)
1 Solution

Accepted Solutions

Re: Set Analysis - Comparing two dates

Does MES_ANO_EXTRACAO and MES_ANO_VAZAMENTO reside in the same table or different tables? If they are in different tables, then you might need to use an if statement

Count(DISTINCT If(MES_ANO_EXTRACAO = MES_ANO_VAZAMENTO, OID_METER))

4 Replies

Re: Set Analysis - Comparing two dates

Try this

Count({<OID_METER = {"=MES_ANO_EXTRACAO = MES_ANO_VAZAMENTO"}>} DISTINCT OID_METER)

eduardo_dimperi
Valued Contributor II

Re: Set Analysis - Comparing two dates

Hi Sunny, not working too.

This is what a have, i did a simple if just to check if they are equal in the right places

If(MES_ANO_EXTRACAO=MES_ANO_VAZAMENTO,'EQUAL','DIFFERENT')

set_analysis.JPG

And this with Set Analysis

set_analysis2.JPG

Re: Set Analysis - Comparing two dates

Does MES_ANO_EXTRACAO and MES_ANO_VAZAMENTO reside in the same table or different tables? If they are in different tables, then you might need to use an if statement

Count(DISTINCT If(MES_ANO_EXTRACAO = MES_ANO_VAZAMENTO, OID_METER))

eduardo_dimperi
Valued Contributor II

Re: Set Analysis - Comparing two dates

Ahhhh didnt know about that, it works, thank you like always Sunny

Community Browser