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: 
Anonymous
Not applicable

How to export formula with Set analysis using macro

I need to export the value of this formula in an excel . Formula contains set analysis.

When I try to export formula it doesn't recognize the set analysis..can anybody please help?

testresult = activedocument.Evaluate("num(only({<Last8WeeksReferencedateOpened = {"$(=max(Last8WeeksReferencedateOpened))"}>}Aggr($(vAging_Incidents_weekly),Last8WeeksReferencedateOpened)),'#0.00')")

msgbox testresult

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

1. create a variable e.g vTest

=num(only({<Last8WeeksReferencedateOpened = {"$(=max(Last8WeeksReferencedateOpened))"}>}Aggr($(vAging_Incidents_weekly),Last8WeeksReferencedateOpened)),'#0.00')


2. Change Macro to:

sub test

testresult = activedocument.Evaluate("vTest")

msgbox(testresult)

end sub

View solution in original post

2 Replies
Frank_Hartmann
Master II
Master II

1. create a variable e.g vTest

=num(only({<Last8WeeksReferencedateOpened = {"$(=max(Last8WeeksReferencedateOpened))"}>}Aggr($(vAging_Incidents_weekly),Last8WeeksReferencedateOpened)),'#0.00')


2. Change Macro to:

sub test

testresult = activedocument.Evaluate("vTest")

msgbox(testresult)

end sub

Anonymous
Not applicable
Author

I used the following

set testresult = ActiveDocument.Variables("vAging_WeeklyReport_LastWeek")

testresult= testresult.getcontent.string

testresult = activedocument.evaluate(testresult)