I have a table called "tempData" where I have a column "rawData" in which I have text value.
E.g. - "One value is AT0001 and another value is - AT0002 in a column other might be AT0005 ok"
I want to fetch the text AT0001, AT0002, AT0005 and put it into another table as a new row.
I tried
REGEX_SUBSTR ("One value is AT0001 and another value is - AT0002 in a column other might be AT0005 ok", "AT....")
But it only return "AT0001". I want all the values.
How can I get that?
Thanks,
Atul
Related
I have a store procedure which brings the data as shown below . I'm new to SSRS reporting, I would like to show only those row where "email" column is null. How can i achieve it in SSRS ? As i mentioned I'm very new to this , any screenshot will help me a lot. Thank you for your time.
For this problem, you'll want to change the row visibility to hide rows with a value in that column. I assume you're using a table or matrix to layout this data. You'll want to right click on the row where your data fields are entered. Specifically, the grey box at the left of the row.
From there, you'll need to select the option to Show or hide based on an expression.
And finally, you'll need to enter an expression that finds the values in the email field. I'm not exactly sure what the field names are called but something like the following expression should do it.
= Not IsNothing(Fields!EmailField.Value)
This will check the field where you get the email value with a built-in function of IsNothing. Additionally, since you want fields that do not contain values, the Not keyword reverses the results. If the function evaluates to true and a value is present, the row will be hidden and vice versa.
I'm using the "phpsoda" library and trying to query the city of Seattle's permits dataset through the Socrata API (SODA). Data: https://data.seattle.gov/Permitting/Land-Use-Permits/ht3q-kdvx
They have several columns such as the ones I'm selecting below, but in the "AppliedDate" and "IssuedDatae" columns, there may or may not be data in that column.
So when I try to look at the array and arrange this into an HTML table, I'm getting some arrays (rows) that have fewer elements (columns) than other rows. This turns out to make it difficult to display since I don't know which columns are missing in the array (row).
I'm wondering if when I make the query, that those empty fields will look they seem in the visualized table on their site or when I export a CSV. Those columns in the query will return into the array element an empty string ("") instead so my rows and columns will come out all filled with values.
$soql->select("PermitNum", "AppliedDate", "IssuedDate", "Description", "OriginalAddress1")
->where("PermitClass = 'Multifamily' OR PermitClass = 'Commercial')
->limit(20);
$results = $ds->getDataset($soql);
Data would look something like...
print_r($results);
Array[0] -> [Description]=>"XXXXXXX", [PermitNum]=>"123456"
Array[1] -> [Description]=>"XXXXXXX", [PermitNum]=>"234567", [AppliedDate]=>"XX/XX/XXXX"
So the first row is missing the "AppliedDate" column just because it's not in the data.
Will I need to just go through this manually in the results array using a loop and checking column names and inserting an empty string if the loop doesn't find a column?
Following my own advice, I was able to just check for each row key if a specific key was missing (array_key_exists function), then I'd fill it in with "" if it returned false.
This seemed to work.
I have same problem. Socrata API will skip empty field or null value. Means, if field is null or empty, the result will not show field-name:'', instead, the result will just missing this, that cause your shorter row.
This is annoying bug, I have to fix it by my own. If I found it missing field, I will have to add field-name:'' to the result json, that will fix your shorter row problem. Make equal length row.
I have a table with three columns, in column 1 I have a name and column 2 I have a quantity.
I want to look up column 1 and return the value in column 2.
I used to the expression below and it wouldn't return what I wanted.
=Lookup(fields!NAME.Value, "Paul" ,1 , 0)
Could anybody tell me what expression I need to use?
You are close, sort of. To use the Lookup function properly, you need to change some things. Here is an example using the Lookup function.
=Lookup(Fields!Field1.Value, Fields!Field1.Value, Fields!Field2.Value, "DatasetB")
It takes 4 parameters. The first is the field/value from the current (in scope) data set that you want to be the value to match in the lookup data set. The second is the field in the lookup data set to match on. The third in the field to return when a match is found, and the last parameter is the name of the lookup data set.
Based on the expression in your question, it may actually work like this:
=Lookup("Paul" , Fields!NAME.Value, Fields!QUANTITY.Value , "DataSet2")
Of course, hard coding the name in the first parameter is probably not what you want to do.
I'm trying to make a MS Access report, where I use a text box to display a field value, then have another text box indicating if the first value is higher or lower than an entry in a separate table.
The report has a record source of "Table 1", and a textbox named "txt_Value1" which displays the number in Field: "Value1". I have a second table, "Customer_Criteria" which has a field "PassValue" that I want to compare against. My expression builder statement is:
IIf([txt_Value1]<(DLookUp("[PassValue]","[Customer_Criteria]","[Customer] = 'ABC'")),"TRUE","FALSE")
This statement always returns false, regardless of what the correct logical result is.
I've tested it, writing:
IIf(1<(DLookUp("[PassValue]","[Customer_Criteria]","[Customer] = 'ABC'")),"TRUE","FALSE")
And I get the correct results. Also, if I write:
IIf([txt_Value1]< 1,"TRUE","FALSE")
I get the correct results. What am I missing to compare the textbox value vs. the Dlookup?
As I understand, both fields are numeric. Access may consider those fields as text, so for correct comparing use type conversion.
Try this:
IIf(CLng(Nz([txt_Value1],0))< _
CLng(Nz(DLookUp("[PassValue]","[Customer_Criteria]","[Customer] = 'ABC'"),0)), _
"TRUE","FALSE")
Nz required if fields may contain NULL values, in this case type conversion function will return error.
I have a text file with more than one table's data in it (different column counts). I import the whole row as one column. Based on a conditional split, the rows are dispersed to their correct flow. I use a script component to split the single column values (row) into the correct columns for that table and give it as output columns. All of this is working fine, and data looks fine.
My problem comes in with some numeric fields. When a numeric field has no values in it, it ends up in the table with another column's numeric value.
I have put data viewers everywhere, in not one of them there is data for the column that should be empty. When I look in the table itself, there it is... data from another column.
It is not the mappings, I checked it a dozen times.
It is not the names that are the same or something like that.
There is no data according to dataviewers anywhere in the load process.
There is no hidden code anywhere.
I droped and recreated the table.
I displayed a messagebox with the column's (that is supposed to be empty) assigned "column value", and no data, like expected.
I used a derived column, same result, no data in dataviewers, but eventualy data in the table.
I also created another test table with those numeric fields as varchar. When I do this, the column is empty (like expected). When I change it to numeric, the field is populated again. (If it was the other way around I could understand).
What can be te reason for this? It is driving me insane.
EDIT
Script code:
//C#
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
ASCIIEncoding enc = new System.Text.ASCIIEncoding();
char[] seperator = { '|' };
Byte[] ByteBlob;
String[] ColumnValue;
ByteBlob = Row.Column0.GetBlobData(0, (int)(Row.Column0.Length));
ColumnValue = enc.GetString(ByteBlob).Split(seperator);
Row.OutputColumn0 = ColumnValue[0];
Row.OutputColumn1 = ColumnValue[1];
///etc
Just to give an example of what it does, this is what a row would look like in a sence.
Column names:
Source|Tablename|Value1|Value2|Description|Value3|Description2|Value4
Actual Data:
ABC|Revenue|123,456|729,537|MisterX||None|
Data in Table:
ABC|Revenue|123,456|729,537|MisterX|729,537|None|729,537
try using Row.ColumnX_IsNull , for example if (Row.Column0_IsNull) {youroutputcolumn=null} else {...}