Want to find fields in a column that start with certain letters - sap

I'm looking to find a way fields that only start with certain letters
Example: Within the "Postcode" column on the report, I want to show only postcodes that start with "CF"
My best guess would be to create an object that marks these down as a number, but I don't know how to identify them.
Thanks for any advice.

In the case of Webi.
You can create variable, wich helds only symbols you are interested in. In your example it would be:
f=left([Postcode];2)
Then restrict table in the report by filter. And add values you want to filter list.

Related

Filtering and display unique column pairs in Excel

Follow on from Excel Count unique value multiple columns
I am trying to filter and setup a table containing all the unique combinations of message types.
So with three message types as an example below, I want to create a table with all the possible flows from this.
So every time MessageA exists, it is either followed by a MessageA, MessageB, MessageC or is the last of the sequence.
And everytime we see MessageC it is only followed by MessageA.
On the left, is the data and on the right is the desired result.
I want this to be able to scale to multiple columns/rows
You could do it by comparing two offset ranges, A1:D5 and B1:E5
=SUMPRODUCT(($A$1:$D$5=$G2)*($B$1:$E$5=K$1))
As you can see, I have cheated slightly by setting K1 blank so it compares correctly with column E, but this could be made part of a longer formula if it was necessary to have END as the column header for K.

Postgresql, Delete characters within strings

I am new to PostgreSQL and am attempting to create a query that will clean up certain columns within a table. By "clean up" I mean delete all characters before or after a certain symbol.
I have one column called "Campaign" within a table called "Adwords".The column has this string/structure within all rows, DE-SRC-Brand. The only place that I would like to keep in this column would be where Brand currently is. I had previously done this manually through excel by doing a simple search and replace with "*-" as the searching criteria.
How would this formula translate to PostgreSQL? How would it then also change if I would like to delete characters in front of a certain designated symbol. Please let me know if anything is unclear as I am still new to this program.
If you want to extract the brand, you can use substring() with a pattern:
select substring(campaign from '%-%-#"%#"' for '#') as brand
from adwords;
You can incorporate this into an update:
update adwords
set campaign = substring(campaign from '%-%-#"%#"' for '#')
where campaign like '%-%-%';

Query several ranges and add automatically a column to know the source of each row

I am trying to achieve the following in Google Spreadsheets.
First, I want to query several ranges (in different sheets from the same spreadsheet). I tried a formula like this =query(arrayformula({indirect(E2:E10)}),"select * where Col1 <>''") with no success
In E2:E10 I have a list of ranges. Column F contains a name that describes the source of the value in Column E.
My second problem is that I need to add a column to the output of that query that tells me the origin of each row.
If the sources are ranges of 3 columns by country I need to merge those tables and add that country to each row.
All credits to +Ben Liebrand who helped me out here: https://support.google.com/docs/profile/3464
"I just want to start of by saying that the indirect() function does not work in an arrayformula() function as expected. So you will need to take another approach. I can understand what you are trying to do so I added another TAB in your spreadsheet to demonstrate another approach. I know it was initially a specific design you were trying so I made some changes to what you had. Maybe you can take a look at what I have offered and maybe you can tweak your design.
I know what I am offering is just very rough but you will also notice that I removed the end row specifier from your ranges in the range table.
Don't assume my example to be the final result but I was just trying to show that the range you were trying to use with the indirect() function will not work.
So hopefully this will give you a new idea of how you can maybe handle this.
My formula also adds the country to each of the tables in the output. My formula looks like this
=query(ArrayFormula({
if(len(indirect(regexextract(F2,"\w+\!\w+")&":A")),G2,),indirect(F2);
if(len(indirect(regexextract(F3,"\w+\!\w+")&":A")),G3,),indirect(F3);
if(len(indirect(regexextract(F4,"\w+\!\w+")&":A")),G4,),indirect(F4);
if(len(indirect(regexextract(F5,"\w+\!\w+")&":A")),G5,),indirect(F5);
if(len(indirect(regexextract(F6,"\w+\!\w+")&":A")),G6,),indirect(F6);
if(len(indirect(regexextract(F7,"\w+\!\w+")&":A")),G7,),indirect(F7)
})," select * where Col1 <> '' ")
Hope this is of some help to you"
And I hope is useful to the community
GerĂ³nimo

Need a simple search function to display most common value in a column. (with ambiguous choices)

I have a very large array of data with many columns that display different outputs for the values presented. I would like to add a row above the data that will display the most common occurring value or word below.
Generally I would like to have each top of the column (right under the column label in row 1) have the most common value below. I will then use this value for various data analysis functions!
Is this possible, and if so, how? Preferably this will not require VBA, but simply a short code in the cell.
One caveat: The exact values may vary, so there is no set list where I can say "it will be one of these."
Any ideas appreciated!
Try a series of =COUNTIF(A:A,"VALUE TO SEARCH") functions if you want to stay away from VBA.
Otherwise, the best method would be to iterate through each column via VBA. With this method, you can even count the "varying" values and return the count and/or the value itself.
http://www.excel-easy.com/examples/most-frequently-occurring-word.html
This is a single formula you would write at the top of each column. Does not require VBA. You can replace the set range to an entire column, such as (A:A) instead of (A1:A7).
If you mean an array as in a data type, it could work differently but it depends what you're trying to do.
With data from A3 through A16, in A2 enter:
=INDEX($A$3:$A$16,MODE(MATCH($A$3:$A$16,$A$3:$A$16,0)))
This will work for text as well as numbers. Adjust this to match the column size.

Create list from data range

I was hoping to get a bit of help regarding formulas in Excel/VBA, I'm looking to do the following but I'm not sure how best to do it:
Okay, so I have a materials export from a piece of software and it comes out with the following sort of data:
In essence I would like to have a catalogue stored on a separate sheet which the function references for text strings that may be contained in a takeoff.
i.e. in E2 the function will check the column B for cells containing the text strings in A16:A18 (the consoles) and return any results along with the corresponding quantity to columns E and F. Similarly this will occur for the controller and cables.
I'm sure there's a solution somewhere but I've been unable to find one for lack of knowing what to search exactly.
Thanks for any help guys, it's appreciated.
What you may want to use is the COUNTIF function. Try this:
COUNTIF(A$2:A$13,"*" & A16 & "*")
If I am not mistaken you can check for the values in A16:A23 in the database dump column B1:B13, then you want the summer quantity for the matching values, where a match means the text you look for must be contained in the database dump column.
To get the quantity accordingly use the following formula in cell B16:
=SUMIFS(C$2:C$13;B$2:B$13;"*"&A16&"*")
then drag it into the other cells. The asterisks are text wildcards, so there may be text in front or behind the text part we look for.