Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
pkelly
Specialist
Specialist

Validate Pasted Entries

The following is a follow on from http://community.qlik.com/message/143579#143579

With the help of the forum I now have a report whereby the user can paste a list of customers into an input box and apply these as a filter.

What I would now like to do is validate this list against my customer table and report back any customer codes from the pasted list that are incorrect (do not exist).

Any ideas on how to achieve this?

2 Replies
pkelly
Specialist
Specialist
Author

Hi...

So far I have got the code below...

Need help with the most important bit which is - how do I check the value variable against my table to see if it exists within vbScript?

sub Filter


' Get pasted values from input box and update strVariable

set v = ActiveDocument.Variables("varCustomer")
strVariable = v.GetContent.String

' Separate Data with Commas

vOptions = ucase("'" & replace(strVariable, chr(32), "','") & "'")

' Update varCustomer with comma separatated array

v.SetContent vOptions,true

' Validate Entries

' Reset varCustomerCheck

set vCheck = ActiveDocument.Variables("varCustomerCheck")
vCheck.SetContent "",true

' Get updated varCustomerCheck variable and split

varArray = v.GetContent.String
varValue = split(varArray,",")

' Set Validation Field

Set obj =ActiveDocument.Getfield("%CustomerKey")
obj.clear

for i=lbound(varValue) to ubound(varValue)

' How do I check the variabkle against my Customer Table?

next


' Apply filter

ActiveDocument.ClearAll true

Set C=ActiveDocument.Getfield("%CustomerKey")
C.Select "=match(%CustomerKey," & vOptions & ")"

end sub

pkelly
Specialist
Specialist
Author

Any ideas?