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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How will you calculate Date range from start date to end date

How will you calculate Date range from start date to end date


set sd=ActiveDocument.Variables("sd")
msgbox("StartDate"&sd.GetContent.String)

set ed=ActiveDocument.Variables("ed")
msgbox("EndDate"&ed.GetContent.String)


edate=CDate(ed.GetContent.String)
sdate=CDate(sd.GetContent.String)


set endate=CDate(edate-sdate)

for i=0 to endate.count -1

msgbox("New Date:"&endate.item(i).text)

next

2 Replies
Not applicable
Author

using this i got .....

first find the date differnce... from that we calculate remaining easily...

sub ed_final

set sd=ActiveDocument.Variables("sd")

'msgbox("StartDate"&sd.GetContent.String)

set ed=ActiveDocument.Variables("ed")

'msgbox("EndDate"&ed.GetContent.String)

edate=CDate(ed.GetContent.String)

sdate=CDate(sd.GetContent.String)

endate=DateDiff("d",sdate,edate)

'msgbox(endate)

ActiveDocument.Fields("ncolum").select sdate+1

for i=2 to endate

ActiveDocument.Fields("ncolum").ToggleSelect sdate+i

next

end sub



Not applicable
Author

Hi

I am not too sure whether it helps you or not. But it is related to date range only. You can look into it!

http://community.qlik.com/forums/t/31125.aspx