Kettle transformation with muli input streams - kettle

I have two files with single fields. It looks like:
File A File B
a1 b1
a2 b2
a3 b3
a4 b4
I would like to have a1,b1; a2,b2 but when I connect two inputs into transformation Kettle says that inputs have different layouts

You don't have any details of your transformation, but I guess you picked the 'Append streams' step. You should use the Merge Join step and two 'Add sequence' step to add a line nr to the input (set a different counter name for both steps). Connect your two 'Add sequence' steps to this 'Merge Join' step configure the key fields as line number and set the join type to: 'FULL OUTER'. Next you can use a Select values step to get rid of the line number columns.

Related

Google Sheets: Joining Two Filters to overwrite selection into 1 Dashboard view

I'm trying to build a workout tracker like shown here
Here is a copy of what I have with dummy data.
Current Attempt/what I've tried/want/notes:
I'd like to have one dashboard (Sheet: Dashboard!) instead of two, where both cells B2 or C2 could be drop downs and I'd like to have it so that the most recent selection takes precedence over the other rules. Currently I've managed to merge the filters with some clunky stepwise IF/THEN, but the final false value supersedes the others, instead of resetting the view.
=IF(
AND(B2="",C2=""), //CONDITION
FILTER(D1S!A1:AA,D1S!B:B=max(D1S!B$5:B1006)), //TRUE VALUE/VIEW
//Maybe OR() around entire FALSE VALUE?
IF( //FALSE VALUE/VIEW
B2 <>"", //CONDITION
FILTER(D1S!A1:AA,D1S!B:B=B2) //TRUE VALUE/VIEW
//AND Change C2 to string 'Exercise' //DESIRED
If( //FALSE VALUE/VIEW
C2<>"", //CONDITION
sort(filter(D1S!A:AA,D1S!C:C=C2),2,FALSE) //TRUE VALUE/VIEW
//AND Change B2 to string "Date" //DESIRED
As a result, I don't think conditionals are the way to go here- instead I think Filter may be better. I just don't know the simplest way to do so for both.
Desired outcome:
Essentially, If both B2 and C2 are blank, get the most recent date workout filter view, If either is filled, then get that view which was most recently selected and make the other cell "blank"/ altered to a header string (eg "date" or "exercise").
EG:
When you open the dashboard- nothing is filled so you get the most recent data.
Then if you select a date in B2, from the drop down you get that filter (ignoring/making C2 say "exercise". Then, with this view, if you select an exercise, it will 1- blank out the value in B2 and say "date" and then 2 the view will just be the filtered view of the exercises.
I hope I explained that clearly. Please let me know if any further clarifications are needed!
add one row above then paste this into B1:
={""; ""; "Date"}
next, paste this into C1:
={""; ""; "Exercise"}
now you can hide row 1 and perhaps change color to reddish and paste this into A3:
=ARRAYFORMULA(QUERY({IF(ISBLANK(D1S!A3:A), D1S!A3:A, ), D1S!B3:AA},
"where 9=9 "&
IF(B3="Date",," and Col2 = date '"&TEXT(B3, "yyyy-mm-dd")&"'")&
IF(C3="Exercise",," and Col3 = '"&C3&"'")))
demo sheet

Creating a nested if statement. If cells K2 or D2 have certain words in

I have a formula right now that looks to cell K2 and writes the word "SKIP" in cell J2 if cell K2 is blank. Like below:
=if(ISBLANK(K2),"SKIP","")
What I want to do is add an additional check, which is, if cell D2 has the word "anonymous" in then keep the word "anonymous" in cell K2. Is this possible?
I tried this:
=if(D2="anonymous","SKIP","",if(ISBLANK(K2),"SKIP",""))
but get the error message "Wrong number of arguments to IF. Expected between 2 and 3 arguments, but received 4 arguments."
Can anyone help? Is Nested IF statements the right way to go? FYI I'm working in google sheets. Thanks.
For background, I have a google sheet that is feeding in user feedback. I am replying to these users via a mail-merge addon with different canned messages. K2 is blank until I manually categorise the feedback type which is added via data validation and until I do that I need J2 to have the word SKIP to ensure the mailmerge tool doesn't email them. Once I've categorised the row, J2 can have the word SKIP removed so that the mail merge tool can email that user. FYI another cell reads from K2 via vlookup to create canned messages. If K2 is anonymous, "SKIP" should remain.
IF statement takes only 3 parameters (logical_expression, value_if_true, value_if_false).
Based on the logic you gave, there's no need to use nested IF since we are modifying 2 different cells.
J2 - =iF(ISBLANK(K2),"SKIP","")
K2 - =IF(D2="anonymous", "anonymous", "")
But if you mean to populate the J2 with "anonymous" instead of K2, you can follow these steps below:
The first thing we have to check is the D2, if D2 have "anonymous" word, we put the word "anonymous" regardless if K2 is blank. Then, if D2 is empty, we will check if K2 is blank then put "SKIP" on it and 'blank' if not. If we will translate this into a IF Statement:
logical expression : D2='anonymous'
value if true : 'anonymous'
value if false : "IF(ISBLANK(K2),'SKIP', '')"
To summarize:
=IF(D2="anonymous","anonymous", if(ISBLANK(K2), "SKIP", ""))
From what you've written and added, I understand the following. You want:
If cell K2 is blank, make J2="SKIP".
If cell D2 = "anonymous", make J2="SKIP".
Values in D2 and K2 are changed manually by you (using a dropdown list?)
This is possible, with the following formula in J2:
=IF( OR( K2="", D2="anonymous"),"SKIP","")
Have I misunderstood anything?
Also, you've said that there might be different words in K2 or D2. Unless you provide us with all the possible words, and the outcomes you want in each case, we can't help you with a proper formula solution.
If you are still having issues, please share a copy of your sheet, since I am having trouble clearly understanding what you want to do.

How to countif 56 exists in 156/56/2567 and only return true once? Google sheets

I have one sheet with data on my facebook ads. I have another sheet with data on the products in my store. I'm having trouble with some countifs where I'm counting how many times my product ID exists in a row where multiple numbers are. They are formatted like this: /2032/2034/2040/1/
It's easy on the rows where only one product ID exists but some rows have multiple ID's separated by a /. And I need to see if the ID exists as a exact match alone or somewhere between the /'s.
Rows with facebook ads data:
A1: /2032/2034/2040/1/
A2: /1548/84/2154/2001/
A3: /2032/1689/1840/2548/
Row with product data:
B1: 2034
C1: I need a countifs here that checks how many times B1 exists in column A. Lets say I have thousands of rows with different variations of A1 where B1 could standalone. How do I count this? I always need exact matches.
You can compare the number you want (56) with the REGEX #MonkeyZeus commented whith a little change -> "(?:^|/)"&B1&"(?:/|$)" so the end result is:
=IF(REGEXMATCH(A1, "(?:^|/)"&B1&"(?:/|$)"), true, false)
Example:
UPDATE
If you need to count the total of 56 in X rows you can change the "True / False" of the condition for "1 / 0" and then do a =SUM(C1:C5) on the last row:
=IF(REGEXMATCH(A1, "(?:^|/)"&B1&"(?:/|$)"), 1, 0)
UPDATE 2
Thanks for contributing. Unfortunately I'm not able to do it this way
since I have loads of data to do this on. Is there a way to do it with
a countif in a single cell without adding a extra step with "sum"?
In that case you can do:
=COUNTA(FILTER(A:A, REGEXMATCH(A:A, "(?:^|/)"&B2&"(?:/|$)")))
Example:
UPDATE 3
With the following condition you check every single possibility just by adding another COUNTIF:
=COUNTIF(A:A,B1) + COUNTIF(A:A, "*/"&B1) + COUNTIF(A:A, B1&"/*") + COUNTIF(A:A, "*/"&B1&"/*")
Hope this helps!
try:
=COUNTIF(SPLIT(A1, "/"), B1)
UPDATE:
=ARRAYFORMULA(IF(A2<>"", {
SUM(IF((REGEXMATCH(""&DATA!C:C, ""&A2))*(DATA!B:B="carousel"), 1, )),
SUM(IF((REGEXMATCH(""&DATA!C:C, ""&A2))*(DATA!B:B="imagepost"), 1, ))}, ))

parse text to cell row column google apps

I have the following lines of text:
Fred A135B246C3
Barney A2B15C126
Wilma A4C4
Betty A6B3C5
Basically what this says is the value "Fred" goes in Cells A1, A3, A5, B2, B4, B6 and C3. While Barney goes into cells A2, B1, B5, C1, C2 and C6. The same process goes for Wilma and Betty.
So I've tried the following functions with limited success: regex(), find(), query() etc.
For example, =REGEXEXTRACT(F1,"A[0-9]*") yields A135 for Fred. In the next cell I put =REGEXEXTRACT(F1,"B[0-9]*"), move over a cell and continue.
This then yields:
screenshot of results.
I can then do another REGEXEXTRACT and get:
screenshot of extended results
I then do some filtering and finally end up with what you see in image 1 columns A-C and rows 1 to 6.
This seems like a lot of work. Can someone suggest another method?
This is the simplest way to achieve it
=split(REGEXreplace(T7279,"(\w\d+)",",$1"),",")
For the first part, I'd suggest something like
=split(REGEXREPLACE(A1,"([A-Z])",";$1"),";")
which would convert "A135B246C3" into "A135", "B246", and "C3"
You can't combine 2nd part with 1st part without creating a convoluted, difficult-to-debug formula.
Another option would be creating a custom function (using Google Apps Script) which would convert "A135B246C3" into "A1,A3,A5,B2,B4,B6,C3", but custom function isn't in your original question.

Adding to cell value based on last non-empty cell in column in Google Sheets

In a column with periodic values (e.g., A1 = "1.1", A2 = " ", A3 = "1.2"), I can't find a solution to automate this.
That is, if A1 = "1.1", I want the next cell in that column to be a sequential number. In other words, if I paste whatever formula comes out of this post into A5, where A1 = 1.1 and A2 to A4 = blank, then A5 should = A1+0.1.
If I'm understanding correctly, this formula could be entered in A5:
=MAX(A$1:A4)+0.1
and then that cell could be copied and pasted in other cells in that column, and the range reference should change as required.
Any easy solution non-VBA would be to run 2 separate columns alongside using this formula from B2:
=if(A2="",B1,B1+0.1)
If you then wanted to clean out some of the values from that list run another formula from C2 with:
=if(B2=B1,"",B2)
and then copy and paste this column as values.