Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Make One Field Equal Another with Trigger and Spaces in Value

I am using a Select in Field document trigger to successfully set the values of one field to another.  The expression I am using is ='('&Concat(Distinct Name1Value,'|')&) ' 

This works great unless the value in the field is 2 words separated by a space, like Bob Smith. 

Any ideas would be appreciated.  I attached a small qvw that demonstrates the issue.

THANKS.

1 Solution

Accepted Solutions
Not applicable
Author

Add an IF statement to your trigger:

=if(GetSelectedCount(Name1Value)>0,'('&Concat(Distinct '"' & Name1Value & '"','|')&')')

View solution in original post

12 Replies
Not applicable
Author

You need double quotes around the names with spaces.

=Concat(Distinct '"' & Name1Value & '"','|')&')'

Not applicable
Author

Here is your file with the updated expression.

Not applicable
Author

Thanks.  I figured quotes would do the trick but wasn't sure exactly where to put them.  Really appreciate the fast answer! 

Richard

Not applicable
Author

Whoops, I spoke too soon.   Try and do a Clear All.   All the values become selected in the list (versus cleared).  Somehow this isn't working right.  Ideas?

Not applicable
Author

Add an IF statement to your trigger:

=if(GetSelectedCount(Name1Value)>0,'('&Concat(Distinct '"' & Name1Value & '"','|')&')')

Not applicable
Author

See attached.

Not applicable
Author

Thanks that's perfect.

One issue I noticed, clicking the BACK button steps back one action at a time, so the fields become unequal again if someone clicks Back.

I could add an action to the Back button, but that's not really ideal since it's a one off.   Any better ideas?  But I might just have to do it.

Thanks again for the expression. 

natebrunner
Contributor III
Contributor III

I just tried this with something I'm working with and noticed the same thing. Hitting BACK really messes everything up. Any good ideas to remedy that?

Not applicable
Author

No ideas.   I spent some time on it and I don't think there is a way to fix it unless there is a way to track exactly what the actual BACK button tracks in the correct order.

So, unless the page content is very narrowly defined that a user can ONLY perform 1 possible type of operation, there seems to be no way to get this to work.  Or you could remove the BACK button functionality I suppose.

Otherwise, it is a BAD idea to do this at all.   I am going to have to work around this issue in the design so I don't ever have to have 1 field automatically trigger another.