Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Order date difference

How to find different in order days

i want to find out difference in order date..like (second order date)-(max order date)

example;max order date-second order date .

       customer id   Product         Order date

    1                   ear phone    17/1/2015          

    1                    Shirt              8/5/2015

   

     8/5/2015-17/1/2015 = if they are in days then diff days  or months

    -----------------------------------------------------

    2                       Book           9/9/2015

    2                     Watch          11/9/2015        

   

    11/9/2015-9/9/2015=    

    -----------------------------------------------------------

    3                  Doumble            6/2/2016           

    3                  Keyboard             2/1/2016  

      2/1/2016-6/2/2016 ==

PFA

8 Replies
rido1421
Creator III
Creator III

Hi John

Are you trying to find the difference in order dates between Products and customers?

eg. customer 1 ordered a "Ear phone"  on 17/1/2015 , when last did customer 1 order "Ear Phone"

You would expect to get the previous order date and then Orderdate-PreviousOrderdate = Amount of Days

is this what you are looking for?

ElizaF
Creator II
Creator II

See the attached file.

I hope to help you!

Not applicable
Author

i want to find out difference in order days .

but that order should  be second order-max order.

my logic should be.

second orderdate -max order date of that customer id.

Anonymous
Not applicable
Author

hi,

suppose you  have a dates like EndDate and StartDate.,

you can calculate the difference between the both the  Date fields like as fallows,

EndDate-StartDate

then it will gets the difference between startdate and enddate.

Anil_Babu_Samineni

Try Like this to get Days between Condition

NetWorkDays(Date(Aggr(Min(OrderDate),[Customer No]),'DD/MM/YYYY') - Date(Aggr(Max(OrderDate,2),[Customer No]),'DD/MM/YYYY'),0)

I got this, Are you happy this O/P

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rido1421
Creator III
Creator III

See if this helps...

Not applicable
Author

Hi anil,

I did this. max order date-min order date. it ok is getting some difference.

but my requirement is  max order date - second order date of a customer i want this difference others as zero

max order date-second order date others er difference should show as zero

Not applicable
Author

Hi Ridhaa,

Thanks..but i want second order date not min order date like

=max order date-second order date not as  max order-min order

plz..