# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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)

Tags (1)
1 Solution

Accepted Solutions
MVP

## 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
MVP

## Re: Set Analysis - Comparing two dates

Try this

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

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')

And this with Set Analysis

MVP

## 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))

Valued Contributor II

## Re: Set Analysis - Comparing two dates

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