Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jsingh71
Partner - Specialist
Partner - Specialist

How I assign macro variable value into qlikview variable???

I created two qlikview variables 'vName' and 'vAvlName'.

through macro I am getting the value from qlikview variable 'vName'.

Sub DispName
set Name1 = ActiveDocument.Variables("vName")
GetUserName = vName.GetContent.String
End Sub

Now in 'GetUserName' variable i got the value.

Now I want to assign this value to qlikview variable 'vAvlName'.

How can I assign this value from macro to qlikview variable.

Please help.........

18 Replies
azimabadi
Creator III
Creator III

ok, please wait a minute, i will update the qvw.

azimabadi
Creator III
Creator III

Sub DispName

          set Name1 = ActiveDocument.Variables("vName")

          set Name2 = ActiveDocument.Variables("vAvlName")

          GetUserName = Name1.GetContent.String

          GetOldUserName = Trim(Name2.GetContent.String)

          if ( GetOldUserName <> "" ) then

                         tmpString = GetOldUserName & "," & GetUserName

          else

                         tmpString = GetUserName

          end if

          Name2.SetContent tmpString , true

End Sub

jsingh71
Partner - Specialist
Partner - Specialist
Author

Thanx a lot both of you...

both answers are correct

azimabadi
Creator III
Creator III

glad this helped

Not applicable


Hi,

    I wrote the macro code for a button to get the current selection in listbox .Like this

SUB GetSelectedValues

SET id= ActiveDocument.Fields("V_Id")

SET selection = id.GetSelectedValues  
if selection.Count=1 then

      msgbox(selection(i).Text)     

      end if             

END SUB


When I click the button ,I need to store the macro variable ( selection) to a qlikview variable which I'll use later in load/select query in  edit script.For example if I assigned the macro variable (selection) to a qlikview variable(say 's'),then the select query would be like this.

select  * from table1 where V_Id=$(s);

suggest me a correct prodecure in assigning macro variable to qlikview  variable.

         Please help me in solving this.Thanks!!

Not applicable

Hi,

Your Post was very useful, Thanks.

But I wanted to ask one thing, suppose if I want to retrieve the latest appended value to the variable how can I do So?

In order to print it in text Box

Thanks in Advance

Not applicable

Hi,

What if suppose I want to retrieve the latest appended value to the variable how can I do So?

In order to print it in text Box

Thanks in Advance

bluecarbon
Partner - Creator
Partner - Creator

Hi Peyman,

Please let me know what is ShownValue.String property of a variable? I m able to get Raw Value of a variable as the expression used in that variable, but I always get ShownValue as empty.

Thanks,

Rakul.

vladimir_f
Contributor II
Contributor II

Hi!

Can you help me too?

my script like that:

**************************

SUB sd3
ActiveDocument.Variables("_sf00").SetContent 0, True
ActiveDocument.Variables("_sf01").SetContent 0, True
ActiveDocument.Variables("_sf02").SetContent 0, True
ActiveDocument.Variables("_sf03").SetContent 1, True
ActiveDocument.Variables("_sf04").SetContent 0, True
ActiveDocument.Variables("_sf05").SetContent 0, True
ActiveDocument.Variables("_sf06").SetContent 0, True
ActiveDocument.Variables("_sf07").SetContent 0, True
ActiveDocument.Variables("_sf08").SetContent 0, True
ActiveDocument.Variables("_sf09").SetContent 0, True
ActiveDocument.Variables("_sf10").SetContent 0, True

END SUB

**************************************

that Macro  working fine...  but...  i need somehow to stop  action History reccording at the start of macro...

because as a result, the button 'Back' stops working..  actually working.. but not properly..

for come to  last step (before i used Macro),   i need to push "BACK"  button  11 times (for each setContent in my macro)

Do you know how to solve this problem?