Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qliksus
Specialist II
Specialist II

Setting a variable value on launch of a hyperlink

hi all,

i am  launching a URL from the straight table box now when i click the hyperlink i want the variable value to be changed  i have to do some actions

on the click of the hyperlink for this .so  how can i track the click in my hyperlink

24 Replies
IAMDV
Luminary Alumni
Luminary Alumni

Hi,

Do you have many Fields in the table? If it is only one Field in the table then you can use this IsActivate property.

Sub CountTableSelections()

    Set obj = ActiveDocument.GetSheetObject( "CH01" )

        IF Obj.IsActive  = True  Then                                                                   

          ActiveDocument.Variables("vTest").SetContent 1 + ActiveDocument.Variables("vTest").GetContent.String,True       

        Else

        End IF

End Sub

Good luck!

Cheers - DV

qliksus
Specialist II
Specialist II
Author

Hi

i can click the table first and then click on the link so in this case even if i simply click the table the variable will be

set  i dont want that to happen what i want is only when i click the hyperlink in the expression the variable should be

set .Also where should i call this macro

IAMDV
Luminary Alumni
Luminary Alumni

I totally agree with you. This is not the best solution and we need the property of Display Options > URL to capture the clicks. I am looking at the API guide and I'll get back to you if I find something better than this one. You use the Field Event Triggers and you can use "OnSelect" event with relevant field selected.

Cheers - DV

qliksus
Specialist II
Specialist II
Author

Guys any update

Not applicable

Just a thought, but if you have built the hyperlink based on the data in your view, i.e.

=[Name]&'<url>'&'http://www.google.com/search?q='&Name

Couldn't you parse the GetCurrentSelections() function to build the variable? Or GetFieldSelections()?

qliksus
Specialist II
Specialist II
Author

hi leonard,

what i am doing is i am passing the value to the URL which is taken as a dimension i.e

https://10.0.2.3/empid=[EMP ID]  where the  EMPID is the dimension in my chart. also when i click the link the

dimension [EMP ID] will not be selected so Getfieldselection() cant be used

Not applicable

Have you tried any field event triggers? Ctrl+Alt+D then go to the triggers tab. Seems you should be able to set the variable and launch the URL based on what you click in the [EMP ID] field? Or at least fire off a macro to do the same?

(Sorry this is way above where I have gone before so not a lot of help...)

qliksus
Specialist II
Specialist II
Author

yes you are right i can trigger something when some field is selected but in this case the field will not be selected

just the link will be clicked so i have track the click on the link and then set a variable on that event

Hope this explains correctly what i need

Not applicable

Could you add a second trigger to launch the URL when the field is

selected and not make the field itself a hyperlink?