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

Calculate Days

Hi,

I have two calendar objects for start date and end date.

When i select dates in these objects, i want to calculate how many days and place it in a textbox.

How can I achieve this??

For ex :

Start
  Date
End Date

01-Jul-14

06-Jul-14

Duration5

Regards,

Shruthi

5 Replies
VishalWaghole
Specialist II
Specialist II

Hi Shruthi,

Try this

=GetFieldSelections(End Date)-GetFieldSelections(Start Date)

Hope it work for you.

-- Regards,

Vishal Waghole

Not applicable
Author

datee:

load * inline

[startdate, enddate

23-MAY-2014,28-MAY-2014

];

load date#(enddate,'D-MMM-YYYY' )   - date#(startdate,'D-MMM-YYYY') as ed Resident datee;

set

"=ed"

in Text object >properties > general tab > text

MK_QSL
MVP
MVP

Try

=Interval(Date(Date#([End Date],'DD-MMM-YYYY')) - Date(Date#([Start Date],'DD-MMM-YYYY')),'dd')

or

=Interval(Date(Date#(Max([End Date]),'DD-MMM-YYYY')) - Date(Date#(Max([Start Date]),'DD-MMM-YYYY')),'dd')

DavidFoster1
Specialist
Specialist

I think some detail got lost in translation there.

Could you provide some sample data (at least 2 rows) and the desired result?

Not applicable
Author

Try the interval key function to get those values inbetween the two dates