# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor

## Date and Set Analysis

Hi,

I have a field date and I want calculate the difference of a measure between the max date and min date selected, setting them in a set analysis. Something like this:

sum( {\$<Date= Max(Date)>},measure ) - sum( {\$<Date= Min(Date)>},measure ).

How can I do it?

Thank you

Savio

Tags (2)
1 Solution

Accepted Solutions
MVP

## Re: Date and Set Analysis

May be this:

Sum({\$<Date = {"\$(=Date(Max(Date), 'DateFieldFormat'))"}>} measure) - Sum({\$<Date = {"\$(=Date(Min(Date), 'DateFieldFormat'))"}>} measure)

4 Replies
MVP

## Re: Date and Set Analysis

May be this:

Sum({\$<Date = {"\$(=Date(Max(Date), 'DateFieldFormat'))"}>} measure) - Sum({\$<Date = {"\$(=Date(Min(Date), 'DateFieldFormat'))"}>} measure)

MVP

## Re: Date and Set Analysis

Try like:

sum( {\$<Date= {'\$(=Date(Max(Date)))'}>} measure ) - sum( {\$<Date= {'\$(=Date(Min(Date)))'}>} measure )

## Re: Date and Set Analysis

You were quite close. Try this:

sum( {\$<Date={\$(=Max(Date))}>},measure ) - sum({\$<Date={\$(=Min(Date))}>},measure )

If it doesn't work then perhaps your Date field isn't a real date field or there's some issue with the date format. In that case please post a small qlikview document that demonstrates the issue.

talk is cheap, supply exceeds demand
New Contributor