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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
mr_ramshini
Contributor III
Contributor III

trend graphs

How do I create trend graphs that its data is extracted from a site?

In other words a trend graph stock over a period of 1 year'd click View Show  So that relevant data is automatically extracted from a specific site, and click view my files show.

Each time you click View, implemented and updated data files and the moment of the extraction site and show it.

Please send to me if you have similar samples.

I am very grateful if someone help me in this regard.

Labels (1)
23 Replies
mr_ramshini
Contributor III
Contributor III
Author

Its my file

i write this code in the tools->edit module

Sub ws

  Const HOST = "http://www.tsetmc.com/Loader.aspx?ParTree=151311&i=42354736493447489"

  Const URL = "tsetmc.com"

  'Create xmlhttp opject

  Set xmlhttp = CreateObject("Microsoft.XMLHTTP")

  'Get the selected zip code

  set fld=ActiveDocument.GetField("ZipCode")

  'If user has selected more than one zip code, show error, else get the Zip

  if ActiveDocument.Evaluate("GetPossibleCount(ZipCode)") = 1 then

  zip = ActiveDocument.Evaluate("trim(ZipCode)") ' Get selected zip

  else

  msgbox ("Please select only one Zip code")

  exit sub

  end if

  'Call HTTP Get method passing WS URL and parameters

  xmlhttp.open "GET", _

     HOST & URL & "/GetCityForecastByZIP?ZIP=" & zip, false

    

  xmlhttp.send ""

  'Create a temporary file to save the results from WS

  ' Path is the folder where this qvw is

  Path = ActiveDocument.Evaluate("left(DocumentPath(), index(DocumentPath(), '\', -1))")

  FileName = Path & "XMLOutput.xml"

  set fso = CreateObject("Scripting.FileSystemObject")

    set s = fso.CreateTextFile(FileName, True)

    s.writeline(xmlhttp.responseText)

    s.Close()

   

  'Load document with the temp file - DoReload will not show progress dialog

  ActiveDocument.DoReload 2, true 'Fail on error, Partial Reload

  'Delete the temp file

  fso.DeleteFile(FileName)

end sub

Function NewDate(cntr)

  'Since the webservice is returning a constant date,

  'I had to use this funtion to generate dates of next 7 days

  NewDate = cstr(FormatDateTime(DateAdd("d",cntr,now),2))

End Function

mr_ramshini
Contributor III
Contributor III
Author

Its my file

i write this code in the tools->edit module

Sub ws

  Const HOST = "http://www.tsetmc.com/Loader.aspx?ParTree=151311&i=42354736493447489"

  Const URL = "tsetmc.com"

  'Create xmlhttp opject

  Set xmlhttp = CreateObject("Microsoft.XMLHTTP")

  'Get the selected zip code

  set fld=ActiveDocument.GetField("ZipCode")

  'If user has selected more than one zip code, show error, else get the Zip

  if ActiveDocument.Evaluate("GetPossibleCount(ZipCode)") = 1 then

  zip = ActiveDocument.Evaluate("trim(ZipCode)") ' Get selected zip

  else

  msgbox ("Please select only one Zip code")

  exit sub

  end if

  'Call HTTP Get method passing WS URL and parameters

  xmlhttp.open "GET", _

     HOST & URL & "/GetCityForecastByZIP?ZIP=" & zip, false

   

  xmlhttp.send ""

  'Create a temporary file to save the results from WS

  ' Path is the folder where this qvw is

  Path = ActiveDocument.Evaluate("left(DocumentPath(), index(DocumentPath(), '\', -1))")

  FileName = Path & "XMLOutput.xml"

  set fso = CreateObject("Scripting.FileSystemObject")

    set s = fso.CreateTextFile(FileName, True)

    s.writeline(xmlhttp.responseText)

    s.Close()

  

  'Load document with the temp file - DoReload will not show progress dialog

  ActiveDocument.DoReload 2, true 'Fail on error, Partial Reload

  'Delete the temp file

  fso.DeleteFile(FileName)

end sub

Function NewDate(cntr)

  'Since the webservice is returning a constant date,

  'I had to use this funtion to generate dates of next 7 days

  NewDate = cstr(FormatDateTime(DateAdd("d",cntr,now),2))

End Function

mr_ramshini
Contributor III
Contributor III
Author

Hi Frank

I want design a button that when i press it all my charts on the sheet become hidden

Frank_Hartmann
Master II
Master II

Have a look here:

Clear Button