Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Action to clear fields

Hi all,

I need to set up an action on some buttons to clear some fields, eg..

i need to clear the following fields

WO_RespondByDate

WO_RespondByMonth

WO_RespondByYear

WO_RespondByQuarter

WO_RespondByPeriod

WO_RespondByDay

I know i can list these individually and set up 6 actions but i was wondering if there was a way i can use something like the wildmatch function which will just clear any field starting with WO_RespondBy*

Is this possible or do i need to list them seperately.

I'm not sure if having more actions will affect the performance (i already have 5 actions on the button)

Thanks in advance

7 Replies
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

anybody have any ideas?

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

hi, thanks for the reply. but thats not what i want.

i have 4 buttons that relate to different date fields.

RespondByDate

CompletedDate

RaisedDate

SoldDate

when the CompletedDate button is clicked it passes the values of the 6 static date fields (from a date island) Date, Month, Year, Period etc to 6 variables then theres more actions that that assign the variable values to the CompletedDate Fields (CompletedDate, CompletedMonth, CompletedYear etc). the problem i have is that if i first make selections and select completedDate, i will have current selections on the completedDate fields, if i then click RaisedDate, i will then have selections on both CompletedDate and RaisedDate whereas i would only want selections on RaisedDate.

So i need to have an action that will clear all selections on the CompletedDate fields before applying them to RaisedDate.

Does that make sense?

Not applicable

Hi

Try like this

Create a macro by specifying the clear filelds and call the macro from the button click.

Eg:

Sub ClearSpecificFields       //Call this macro from a button clcik

ActiveDocument.Fields("WO_RespondByDate").ClearAll

ActiveDocument.Fields("WO_RespondByMonth").ClearAll

ActiveDocument.Fields("WO_RespondByYear").ClearAll

ActiveDocument.Fields("WO_RespondByQuarter").ClearAll

ActiveDocument.Fields("WO_RespondByPeriod").ClearAll

ActiveDocument.Fields("WO_RespondByDay").ClearAll

End Sub

Hope it will solve your problem.

Regards

===========

Kumar

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks for your reply.

The macro really is no different then setting up individual actions.

I thought there might have been a way to use a function like the wildmatch that will clear all fields starting with WO_RespondBy*

Thanks anyway

Not applicable

I don't think you can use wildmatch in this case.

But I doubt it would the performance would be better even if you could

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

ok thanks, i will just creat seperate actions

yakir_manor
Contributor III
Contributor III

this can be annoying, i wrote a code that will only clear the fields that are selected, you can check this qvw, this also allows you to just list those fields in an island instead of repeating code.