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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro - select from two fields using 'Or'!

Howdy!

I have a field called Portfolio.  Associated with each Portfolio is a list of characteristics that need to be automatically filtered on when that Portfolio is selected to give me a list of Projects that meet those criteria.

So for instance - Portfolio A has the following fields: Division=Soup, Status = Hot

Portfolio B has the following fields: Business=Nuts, Project = SomeProjectName

Portfolio C has the following fields: Division=Soup, Business=Nuts

When the user selects Portfolio A, the macro that I have created and associated with the Portfolio field event trigger in the Document Properties successfully gets all Projects with a Division of Soup AND a Status of Hot.  LIkewise for Portfolio B.

My problem comes with Portfolio C because Division and Business need to be selected using 'OR' logic - show me all projects where Division = Soup OR Business = Nuts.

This is what a portion of my macro looks like for setting one of the filters:

~~~~~~~~~~~~~~~~~~

' Set Tech Platform

  set val=ActiveDocument.Fields("Tech Platform List").GetPossibleValues

  set val1=ActiveDocument.Fields("Tech Platform")

  set fv=val1.GetNoValues

  for i = 0 to val.Count-1

  fv.Add

  fv(i).Text = val.Item(i).Text

  fv(i).IsNumeric = false

  next

  val1.SelectValues fv

~~~~~~~~~~~~~~~~~~

This works like a champ! 

So how do I alter this to 'OR' another value in there??

Any help appreciated!!

0 Replies