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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Retrieving the currently selected date and time range via a VB macro

Hi,

I have a date field in my Qlikview report of the format 2009-12-07 23:26:09.

I am launching an external application via a button macro that requires a start date/time and end date/time and I would like to pass the current filtered date/time range in the format:

from_date=YYYY.MM.DD

from_time=HH:MM

Is there a way to extract the currently active date/time start and end range from the report using a VBScript macro?

Thanks!

Sandy

1 Solution

Accepted Solutions
Not applicable
Author

Sorry - I have found my own answer.

sub UTEL

Dim utelimsi

Dim mindate

DIm mintime

Dim maxdate

Dim maxtime

utelimsi = ActiveDocument.Evaluate("imsi")

mindate = ActiveDocument.Evaluate("date(min(date),'YYYY.MM.DD')")

maxdate = ActiveDocument.Evaluate("date(max(date),'YYYY.MM.DD')")

mintime = ActiveDocument.Evaluate("time(min(date),'HH')")

maxtime = ActiveDocument.Evaluate("time(max(date),'HH')")

set WshShell = CreateObject("WScript.Shell")

WshShell.Run "iexplore.exe http://10.0.1.98/cgi-bin/uqos/tcapsearch.pl??Action=Search&Category=TCAP&From_Date="&mindate&"&From_Time="&mintime&":00&To_Date="&maxdate&"&To_Time="&maxtime&":59&Field=imsi&Operator=&Value=&bind1=and&Sub=&bind2=and&Expression=((imsi="&utelimsi&"))&Button=View",3,true

end sub



View solution in original post

1 Reply
Not applicable
Author

Sorry - I have found my own answer.

sub UTEL

Dim utelimsi

Dim mindate

DIm mintime

Dim maxdate

Dim maxtime

utelimsi = ActiveDocument.Evaluate("imsi")

mindate = ActiveDocument.Evaluate("date(min(date),'YYYY.MM.DD')")

maxdate = ActiveDocument.Evaluate("date(max(date),'YYYY.MM.DD')")

mintime = ActiveDocument.Evaluate("time(min(date),'HH')")

maxtime = ActiveDocument.Evaluate("time(max(date),'HH')")

set WshShell = CreateObject("WScript.Shell")

WshShell.Run "iexplore.exe http://10.0.1.98/cgi-bin/uqos/tcapsearch.pl??Action=Search&Category=TCAP&From_Date="&mindate&"&From_Time="&mintime&":00&To_Date="&maxdate&"&To_Time="&maxtime&":59&Field=imsi&Operator=&Value=&bind1=and&Sub=&bind2=and&Expression=((imsi="&utelimsi&"))&Button=View",3,true

end sub