Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Min Date

Hello,

I've got a table WORKORDER:

ID_W

ID_GROUP

IS_OPENED (Boolean)

DATE

I'd like to get the first date that is still opened by ID_GROUP

May be Can I use Previous or Peek ? I dont know really.

Regards.

DAAM

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

MinDate:

Load ID_GROUP, min(DATE) as MIN_DATE

Resident WORKORDER

Where IS_OPENED = 1

Group By ID_GROUP;

If you don't want the minimum date but simply the first date value encountered you can use FirstValue(DATE) instead of min(DATE).


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
tresesco
MVP
MVP

In the script?

Max:

Load Max(Date) as MaxDate  FROM <> where IS_OPEN='Y';  // or may be IS_OPEN='1'

Let vMaxdate = Peek('MaxDate')  ;  // now the variable holds the max date

Drop table Max;

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

MinDate:

Load ID_GROUP, min(DATE) as MIN_DATE

Resident WORKORDER

Where IS_OPENED = 1

Group By ID_GROUP;

If you don't want the minimum date but simply the first date value encountered you can use FirstValue(DATE) instead of min(DATE).


talk is cheap, supply exceeds demand
MayilVahanan

Hi

Try with firstvalue() function to get the first value for id group.

Load ID_GROUP, FirstValue(DATE) as MIN_DATE

Resident WORKORDER

Where IS_OPENED = 1

Group By ID_GROUP;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi Thank

I used First Value

Regards