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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting a variable with an array of values taken by a pivot table though a macro

Hi all,

I'm trying to set a variable into a qlikview document with a list of values taken from a column of a pivot table.

Here's the code:

sub GetContattiInviti


set table = ActiveDocument.GetSheetObject("CH146")


'set field = ActiveDocument.Fields("Con_cod_contatto")


'set arrayValori = field.GetNoValues


dim arrayValori: arrayValori=(table.GetRowCount)


cont = 0


for RowIter = 1 to table.GetRowCount-1

set cell = table.GetCell(RowIter,2)

if cell.Text <> "0" then arrayValori(cont).Text = cell.Text

cont = cont + 1

next


set contattiPriorita = ActiveDocument.Variables("Contatti_Priorita")

contattiPriorita.SetContent arrayValori,true


end sub

The instruction

arrayValori(cont).Text = cell.Text

gives me Type Mismatch error.

I tried a lot of things without success.

Any suggestions?

Thanks in advance!

2 Replies
Not applicable
Author

Upload your QV app

nathanfurby
Specialist
Specialist

Hi alecatta - did you find a solution for this? thanks