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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtering with ActiveDocument.Fields

Hi all,

I've got a macro:


sub Filtro_Sosp_Uff_Comm
set f = ActiveDocument.Fields("mo_serie")
set g = ActiveDocument.Fields("Comp_Critico")
set h = ActiveDocument.Fields("ar_tipo")
set i = ActiveDocument.Fields("ar_critico")
set l = ActiveDocument.Fields("Sospeso")


f.Select "<>" & "C"
l.Select "S"
h.Select "M"
i.Select "<>" & "S"
g.Select "<>" & "S"

end sub


I've to filter the data on a tableBox with these conditions:

mo_serie <>'C' and Sospeso = 'S'and ar_critico <> 'S' and ar_tipo ='M' and Comp_Critico <> 'S'

but the macro doesn't work.

Any suggestion?

Thanks in advance.

Andrea

6 Replies
Not applicable
Author

Try this:

<pre>sub Filtro_Sosp_Uff_Comm
set f = ActiveDocument.Fields("mo_serie")
set g = ActiveDocument.Fields("Comp_Critico")
set h = ActiveDocument.Fields("ar_tipo")
set i = ActiveDocument.Fields("ar_critico")
set l = ActiveDocument.Fields("Sospeso")


f.Select "<>C"
l.Select "S"
h.Select "M"
i.Select "<>S"
g.Select "<>S"

end sub



But I have a question, why are you using macro for this? You can do this manually in an application. If you need this for data access restriction with data reduction, it will be better use the Security Section Access.

Anonymous
Not applicable
Author

Or, you can combine both:
- In application, make selections and save as boomark.
- In macro, only recall this bookmark.

Not applicable
Author

I've three charts wich count the number of record that match three conditions.

I'd like to open a table clicking on the chart filtered with the same conditions.

To do this i've created a button with a macro associated. attacched you will find the qvw.

The macro are associated in the 3rd and 4th sheet.

Thanks in advance

Not applicable
Author

Nobody can Help?

Not applicable
Author

Hi,

I have the same problem

set margenDurEvento=ActiveDocument.GetVariable("MargenDurEvento")
set margenMontoDesc=ActiveDocument.GetVariable("MargenMontoDesc")
set f = ActiveDocument.Fields("Descuentos.DIF_DURACION")
set g = ActiveDocument.Fields("Descuentos.DIF_MONTO_DESC")
f.Select(">" & margenDurEvento.GetContent.String)
g.Select(">" & margenMontoDesc.GetContent.String)

I need something like

f.Select(">" & margenDurEvento.GetContent.String) AND g.Select(">" & margenMontoDesc.GetContent.String)

Thanks in advance Smile

Not applicable
Author

Hello all,

I have one field ReloadDate which carries only the date when the report was reloaded. I need to compare ReloadDate with current date in a macro written using VBScript.. so how can I do that? 

I tried with

set dte = ActiveDocument.Fields("ReloadDate").GetPossibleValues

if  (dte = Date) then

------------------

end if

But the type mismatch error occures. Also tried with

if  (dte.item(0) = Date) then

------------------

end if

But again "Wrong number of arguments or invalid property assignment: 'dte.item'" error occures.

How to fix the issue??

Please reply