# Qlik Sense App Development

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
New Contributor

## Calculate number of Min()

Hi,

I'm new so tried here for the first time 🙂

I have a qvd like this :

 A B C date nb TEXT1 TEXT1 TEXT1 10/01/2018 1 TEXT2 TEXT2 TEXT2 20/01/2018 1 TEXT2 TEXT2 TEXT2 21/01/2018 1 TEXT3 TEXT3 TEXT3 30/01/2018 1 TEXT3 TEXT3 TEXT3 30/01/2018 1

I would like to obtain the nb of minimum date :

 A B C =min(date) nb of minimum date TEXT1 TEXT1 TEXT1 10/01/2018 1 TEXT2 TEXT2 TEXT2 20/02/2018 1 TEXT3 TEXT3 TEXT3 30/03/2018 2

I have tried this but it's not enough : Aggr(Min(date), A, B, C)

Do you know someting to do that ?

2 Replies
Highlighted
Valued Contributor

## Re: Calculate number of Min()

Data:
A, B, C, date, nb
TEXT1, TEXT1, TEXT1, 10/01/2018, 1
TEXT2, TEXT2, TEXT2, 20/01/2018, 1
TEXT2, TEXT2, TEXT2, 21/01/2018, 1
TEXT3, TEXT3, TEXT3, 30/01/2018, 1
TEXT3, TEXT3, TEXT3, 30/01/2018, 1
];

output:
noconcatenate
load A,B,C, min(date) as min resident Data group by A,B,C;
left join load * resident Data;

drop table Data;

final:
noconcatenate

load if(date=min,1,0) as flag,* resident output;

drop table output;

Taoufiq ZARRA
Highlighted
New Contributor

## Re: Calculate number of Min()

First thank you for your solution.

I forget to mention explicitly I was trying to do this with Set Analysis and not in Script.

Is there any possibility with Set Analysis (or not recommended) ?