Topic Urgent help

folarin86 started the topic:
2018-07-12 07:58

Urgent help

Im new to datacleaner, I have a little problem, how do I ,Parse and generate all records that “given_name” either starts with “A” or “B” and Parse and generate all records that has “income_amount” of less than 100K. Please i need urgent help.
Arjan replied:
2018-07-12 08:22
For describing how to do this I will assume you're using the Customers.csv datastore which is delivered with DataCleaner.

To check if a "given_name" name starts with "A" or "B" and filter out all negatives, you can best first create a regex. In the "More" menu select "String patterns". This opens the "Reference data" panel. Here are three buttons you can use to create a string pattern, click the one which creates a Regular expression string pattern. Give the pattern a good name and for the String pattern fill in
^[AB].*
.

Now close the panel and add a "Validate with string pattern" filter to the job. In this filter select "given_name" as input column and for the String patterns property, select the pattern which you just created.

Now add a "Convert to number" transformer to the job. By default a transformer has no requirement. Set a requirement for this component. There are multiple manners to do this. When you have the configuration panel of the component open, You see a button containing the text "(No requirement)". Click this button, select the "Validate with string pattern" option and for that select "VALID". Now only the rows for which the "given_name" starts with "A" or "B" will filter through.

In the "Convert to number" transformer you just added, select "income_amount" as input. If you scroll down in the component, you'll see the component now produces "income_amount (as number)" as output.

Now add a "Compare" filter to the job, for this filter, select "income_amount (as number)" as input column, select operator "Less than" and compare value "100000".

Now you can add a writer component to the job, e.g. a "Create CSV file" component (or another writer, depending on your use case). For this component select the requirement "income_amount (as number) < 100000" and set it to "TRUE". Now select the columns to write to the CSV and select a file and you're ready to go.
folarin86 replied:
2018-07-12 09:08
Thanks for your prompt response, the second part went well, but for the give_name I got an error saying illegal repetition for this
^[AB].*
.
Arjan replied:
2018-07-12 09:10
Can you maybe copy/paste the complete error here?
folarin86 replied:
2018-07-12 09:33
Thanks, I got it working
You are not signed in.
You need to be signed in to participate in the discussion.