Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Create End Date per ID and also find Average days between Start and End Dates per ID

 

Hi, I have my data as shown below.

 

ID Date
111 6/1/2023
111 6/2/2023
111 6/3/2023
123 6/3/2023
156 6/11/2023
156 6/12/2023
846 5/14/2023
846 5/14/2023
846 5/15/2023
846 5/16/2023
846 5/17/2023

 

I need to create an End Date and also find average number of days between Date and End Date per ID

ID Date End Date Average Days
111 6/1/2023 6/3/2023  
123 6/3/2023 6/3/2023  
156 6/11/2023 6/12/2023  
846 5/14/2023 5/17/2023  
Labels (4)
3 Replies
G3S
Creator III
Creator III

try in a straight table:
ID,  min(Date),  max(Date),   max(Date)-min(Date)

qlikwiz123
Creator III
Creator III
Author

I already tried this. This does not work. The Min Date works but the Max Date comes up as the latest date for all the IDs. So this has to be done in the script level.

G3S
Creator III
Creator III

it worked for me in a straight table. you can also try aggr.  I've added both below:  (I formatted the date in the front end cos I  used to DD/MM/YYYY in the input)

G3S_0-1686698503443.png