I have one column with data in it. I have an sql query and data underneath then another sql query and the output underneath etc.
I need to split the data from one sql query to another.
Is there a way to do this?
EDITED: I see @jdunkerley79 and I took a very similar approach. Either will work if the data is in separate rows in your original sample.@SZ , are all of the data in one cell, or does your information represent separate rows? My first approach parses if it's all in one cell.If different rows, then this should work:
Can you post sample input and desired output?
I wish to use the word =============== SQL ================ as like a delimiter to split my data.
input sample:
Field_1
=============== SQL ================
<query>
============= RESULT ===============
userid;amount;type
1;10;bet
2;20;win
20;33;bet
66;9;bet
Desired output:
Hi @SZ !Yes. My approach involves a bit of Regex and formula magic. The Regex splits your single cell into distinct rows. It looks to parse on = followed by SQL. The first row is junk so we can discard, and then a Record ID tool is used to assign "rows". That info will be used to build the horizontal table in the crosstab.A Formula tool reinserts the = characters removed by Regex. And a crosstab tool transposes from rows into columns.Please give it a go and let me know if this works.Cheers! Esther
I would user MultiRow formula tools to make row and column ids then cross tab
The first multi row formula will create a column counter adding one every time SQL line is found
The second is grouped by the output of the first to create a row id
Finally a Cross Tabs makes the table
Sample attached