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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro Variable

Hi,

I need your help pleeeassee

I created a qlikview variable and I like to it integrate in a R function but it doesnt work ... The conexion between R and QV

Sub Aprofamm

Set myTable=ActiveDocument.GetSheetObject("DATA")

myTable.Export CurrentPath&"/Simulation/Test.csv",",",0  

'Create a COM object representing R

Set R = CreateObject("StatConnectorSrv.StatConnector")

R.Init "R"

R.EvaluateNoReturn "source('"&CurrentPath&"/TEST.R')"           # CODE R

R.EvaluateNoReturn"COT=Nbre_Cotisant_Regime(base_Cotisant=Base_Cotisant,base_Flux=taux_entree,Age_ret=!!!!!!!!!!!!,N=1,Nouv_Cotisant=5000,t=1)"          #Varaible Age_RET should have the QV library

'Close R connection

R.close  

End Sub

Function CurrentPath()

    Set v = ActiveDocument.GetVariable("vAppPath")

    CurrentPath = Replace(v.GetContent.String,"\","/")

End Function 

Function Variable()  #Read the qlik view variable

    Set v = ActiveDocument.GetVariable("Age_RET")

    Variable = CInt(v.GetContent().String)

End Function 

Help me pleaeeeeeeee

1 Reply
Not applicable
Author

Hi,

did you tryed to monitor execution of this script?

Do you know where exactly is the problem?

regards

Darek