# Qlik Sense App Development

Contributor

## Max of Date by Specific Dimension

Hi,

I need to calculate the max value of date by dimension: Cod_Contratante. Example:

Cod_Contratante Date

1                         1/2/2017

1                         2/2/2017

2                         4/2/2016

2                         3/3/2017

And I need this result:

Cod_Contratante Date           Max(Date)

1                         1/2/2017     2/2/2017

1                         2/2/2017     2/2/2017

2                         4/2/2016     3/3/2017

2                         3/3/2017     3/3/3017

I want to calculate tha max of date by Cod_Contratante.

1 Solution

Accepted Solutions
MVP

## Re: Max of Date by Specific Dimension

max(total <Cod_Contratante> Date)

4 Replies
Honored Contributor II

## Re: Max of Date by Specific Dimension

Try with this:

=Date(Max(Date),'DD/MM/YYYY')

Script:

DATA:

Cod_Contratante, Date

1,1/2/2017

1,2/2/2017

2,4/2/2016

2,3/3/2017

];

MAX:

LOAD Cod_Contratante, max(Date) as MaxDate resident DATA group by Cod_Contratante;

Result:

Contributor

## Re: Max of Date by Specific Dimension

thanks for your help, but If I select a date, MaxDate no change. And I need to change the date according to the selection of date.

If I select date 4/2/2017, I hope this result:

Cod_Contratante Date          Max(Date)

1                        1/2/2017    2/2/2017

1                        2/2/2017    2/2/2017

2                        4/2/2016    4/2/2017

2                        3/3/2017    3/3/3017

this  last registry did not exit in my current selection, and the Max(Date) change.

MVP

## Re: Max of Date by Specific Dimension

max(total <Cod_Contratante> Date)

Contributor

## Re: Max of Date by Specific Dimension

Hi,

I have another problem:

 Año_Emision_Poliza Mes_Emision_Poliza Num_Poliza Estado_Poliza Cod_Contratante Fecha_Emision_Poliza Max(Total Fecha_Emision_Poliza) 2016 dic 0000001302 CADUCADA 021790037665001 09/12/2016 16/12/2016 2016 dic 0000002360 ANULADA 021790037665001 09/12/2016 16/12/2016 2016 dic 0000002492 VIGENTE 021790037665001 12/12/2016 16/12/2016 2016 dic 0000004626 VIGENTE 021790037665001 12/12/2016 16/12/2016 2016 dic 0000002492 VIGENTE 021790037665001 16/12/2016 16/12/2016 2016 dic 0000002501 VIGENTE 021790037665001 16/12/2016 16/12/2016 2016 dic 0000001491 RENOVADA 000910134527 04/12/2016 27/12/2016 2016 dic 0000001454 VIGENTE 000910134527 21/12/2016 27/12/2016 2016 dic 0000003134 CANCELADA 000910134527 27/12/2016 27/12/2016