Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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

Calculate number of Min()

Hi,

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

I have a qvd like this :

A

BCdatenb
TEXT1TEXT1TEXT110/01/20181
TEXT2TEXT2TEXT220/01/20181
TEXT2TEXT2TEXT221/01/20181
TEXT3TEXT3TEXT330/01/20181
TEXT3TEXT3TEXT330/01/20181

 

I would like to obtain the nb of minimum date :

A

BC=min(date)nb of minimum date
TEXT1TEXT1TEXT110/01/20181
TEXT2TEXT2TEXT220/02/20181
TEXT3TEXT3TEXT330/03/20182

 

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
Taoufiq_ZARRA
Valued Contributor

Re: Calculate number of Min()

Data:
LOAD * INLINE [
    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
Max1
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) ?