Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filter on a created field using Action in Button

I am creating a column based on certain conditions. It is not a direct field coming from the source. How do I create a button action on that explicitly created field? i.e, I need to apply filter on that created column when I click on a button.

6 Replies
Clever_Anjos
Employee
Employee

Could you tell us how do you "I am creating a column based on certain conditions"?

Anonymous
Not applicable
Author

A simple example could be as below:

ColumnA:    

2

3

4

5



ColumnB:

S

A

W

V

Explicitly created column:

ColumnC:

if(ColumnA='1',

if(ColumnB='A, 'Designated'))

This becomes my explicitly created column/field in my Expressions Tab

Clever_Anjos
Employee
Employee

Where are you using htis

if(ColumnA='1',

if(ColumnB='A, 'Designated'))

Is it possible to attach a sample?

Preparing examples for Upload - Reduction and Data Scrambling

ankali1990
Contributor III
Contributor III

Hi,

create a variable in the script or ctrl+alt+v

set vFilter = (A|b|c); // A, b and c are values which you want to filter

In button actions:

Create 1st action to be Select in field. Choose your field and for Search string: =(vFilter)

Your button will filter only values within vFilter definition. If you want to select the excluded fields - to select everything other then vFilter values add 2nd action. It has to be Select excluded and chose again the same field.


Hope this will help.

Regards

Anonymous
Not applicable
Author

Hi Anastas, thank you for the help. I know how to create button actions. The use case here is a bit different.

In button actions:

Create 1st action to be Select in field. Choose your field and for Search string: =(vFilter)

Your button will filter only values within vFilter definition. If you want to select the excluded fields - to select everything other then vFilter values add 2nd action. It has to be Select excluded and chose again the same field.


The problem here is "Choose your field"


The Field is not a direct field. I am creating it with multiple 'if' statements in the expression. In this case, how can I add that a 'Field' in the Action?

ankali1990
Contributor III
Contributor III

Hi DRJ Dj,

sorry I missed this:

if(ColumnA='1',

if(ColumnB='A, 'Designated')).

Basically when you select 'Designated' value from your 'New Column' actually you select in:

ColumnA - 1

ColumnB - A

Based on my previous reply, "Choose your field" there are ColumnA and ColumnB. Based on your logic for the 'New column',you should create two actions 'Select in field' and two variables for each field value. Example:

1st Action: Select in field type; Field: ColumnA; Search String: 1 => Make variable

2nd action: Select in field type; Field: ColumnB; Search String: A => Make variable


When you click the button, you will select values for both fields and you will select automatically based on your logic for 'New column' value 'Designated'.


PS: It is better to have these Ifs in the script, but probably you know that and there is any issue for implementing this in the script.

Hope it helps,

Regards