Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
The data is writing out like this ["PII"].
I want to remove the [""] and convert it to PII.
In tMap, I have this expression:
(row14.LABELS!=null && row14.LABELS="" && StringHandling.TRIM(row14.LABELS).length() > 0)?row14.LABELS.replaceAll("[", "")
When I run the job, I am getting the hard error of Detail Message: aggregated_row_tAggregateRow_1 cannot be resolved to a variable.
What am I doing wrong in the above expression? Can I please have an example of how to replace those characters I don't want with blanks if there's data. This column data can be null.
Youll have to escape all double quotes and brackets. The following worked for me:
row14.LABELS != null ? row14.LABELS.replaceAll("[\\[\\]\"]","") : null
You are probably getting that error because you're using an assignment operator '=' when you should be using an equality operator '==' in your conditional. (fyi use '==' for object comparisons and .equals() method for string comparison) If all you need to check is for nulls, my conditional should be sufficient.
Youll have to escape all double quotes and brackets. The following worked for me:
row14.LABELS != null ? row14.LABELS.replaceAll("[\\[\\]\"]","") : null
You are probably getting that error because you're using an assignment operator '=' when you should be using an equality operator '==' in your conditional. (fyi use '==' for object comparisons and .equals() method for string comparison) If all you need to check is for nulls, my conditional should be sufficient.
Thank you so much for your help 😀. This worked. I also appreciate the explanation on when to use == or .equal. I am new to all this.