How can I check if strings match? - google-data-studio

I have a Google Sheet document that I only have read access to.
It has a set of workers in it. One of the fields is for "job location", and another is for "house location". When these fields don't match, the worker is "remote".
I'm trying to add a calculated column to a data source in Google Data Studio, but I can't find any string function that checks for equivalence, and just going J=K doesn't work.
The CASE operator isn't able to compare columns either.
Is there a way to make a formula determine if two fields are equivalent?

For future reference, the feature was introduced in the 07 Jan 2021 update; thus using the fields specified in the question (job location and house location), the CASE statement below does the trick:
CASE
WHEN NOT job location = house location THEN "remote"
ELSE "not remote"
END
Editable Google Data Studio Report and a GIF to elaborate:

Currently, there is no direct solution in Data Studio to do this.
However, you can take one of two approaches:
Create a new Google Sheet. Use IMPORTRANGE to bring in entire dataset from the source Sheet and then add the comparison column in this worksheet. Use ARRAYFORMULA to extend the formula all the way to the end. (e.g. =ARRAYFORMULA(D:D=E:E) - can be further polished) This Sheet can then work as your data source.
Create a Community Connector to fetch data from the Sheet using the Sheets Service. Add the comparison as a column in Apps Script.

Related

Can I Fix the a lookup field in Access database based upon a calculation or another field?

I am trying to create a database with field descriptions for a very large excel file that I have at work. I have created 3 tables- List of sheets, list of variables(including a lookup field pointing at the List of sheets table, so that I can select the sheet to which the variable belongs), and a third table which specify some validation rule.
In this third table, I want to see two lookup fields, one specifying the sheet in which the rule applies(say, 'Select Sheet'), and another specifying the variable(say, 'Select Variable'). I can point to the two different tables, but I want to do something a bit more nuanced than that. When I give a particular sheet name to 'Select Sheet', I want the lookup field for the variable('Select Variable') to show me only those variables which exists in that sheet.
I know that there probably will be solutions using forms, but this database is going to be very detailed and there are things to do afterwards, so I do not want to get into queries and forms before all data has been recorded in tables in a neat manner.
I have a good grasp of VBA in the context of excel and I am given to understand that I can extend the applications of Access using VBA. I am ready to do that, but I want to see before that whether this is some functionality of access that I am missing. Had anyone done anything similar before, and if so, did it take VBA to do it?

How to create an Excel Spreadsheet that formats a field in one of a few different ways based on the data in the field

I have a SQL View that I'm working on that spits out some important information for my boss's boss's boss. The view includes a field called Item ID, which can be in several different formats.
Here are some examples (that may or many not be made up to protect the innocent):
ATS-LC-PLN-RT-RH-0.3125-18-3X2.125X1.5-1
012345.012345
01234567.0123
123456789012
000000.000000
000000.000002
I'd like to take the view and use it to (eventually) produce an excel spreadsheet, but I'm not confident that there's a way to format this column in a way that will work for all of these different Item ID's.
When playing around with Excel, these numbers drop their trailing zeroes and switch to scientific notation, among other shenanigans. I just need to format this column in a way that will preserve the Item ID.
If you know of a way to programmatically create an excel spreadsheet in a way that allows me to assign a format based on the data in the cell, that would work great. The problem that I'm mainly suffering from is that this spreadsheet naturally has hundreds of lines, soon to be thousands, and there's no feasible way to hand-format these lines one at a time on a daily or weekly basis.
I've got SQL-Server 2014 and Excel via Microsoft Office Standard 2013, which may offer more options.
Permit me to suggest another way of framing your issue. I don't think you really want to analyze (either manually or programmatically) each item ID and determine whether it is an integer, a decimal, or alphanumeric text. Since your item ID data varies, the only Excel formatting that will work for all of your cases is 'Text.' So my suggestion is look for a way to automate the export of your data to Excel while making sure that the formatting in Excel is set to 'Text' for all cells to contain your item ID data. As you've noticed, if you are pasting data in Excel, if the target cells are not first set to 'Text' formatting, Excel will make its own 'corrections' to each pasted value, including removal of leading and trailing zeros.
The best solution is to use SQL Server Reporting Services (SSRS). You can set the field formatting in SSRS, and then (if you choose) automate the export of your data to Excel by calling the report server by URL with &rs:Format=excel. (There is learning curve for SSRS but if you plan to continue doing things like this, it will be worth it.)
Other options
The easiest manual option is to 1) export the data to .csv format, 2) Open Excel and use the Text Import Wizard, and during Step 3 make sure to click the data column and then choose 'Text' as the data format. (You could automate this somewhat with an Excel VBA macro.)
The most complicated method involves programming using Excel VBA and ADO to automate the connection and querying of the data from your database view, and then rendering that data to a spreadsheet, using VBA to set the formatting to 'Text.'

Complex linking in excel (dynamically?)

I'm not the best at using spreadsheets but I've given a task and its possible I may be a little out of my depth (I'm more of a web programmer)
I have two sheets:
One called Area A and one called Area B with headings:
Time - Location - Reference
I need to set up a new sheet with these column headings:
Time - Reference - Location - Area
Then make a sortable list (I can do this bit)
The Location A & B sheets will be constantly changing and this will need to be reflected in the new sheet when ever it is opened (maybe some sort of onload style event?)
Any ideas on the easiest way to do the above (or if indeed it is doable)? I don't want to be spoon fed, I'd be happy to be pointed in the right direction or to be given some keywords I can Google (I learn better this way).
Many thanks!
This type of data manipulation is something that excel is not good for and is prone to errors.
The best two good ways to do this.
Manually
On sheet "Area A" add a column with area name I.e. Area A. Do this for each "data" sheet. Then manually or via vba copy and paste one sheet at a time to you're aggregated sheet.
Programmatically using VBA
Loop through each sheet and copy and paste to the aggregated sheet adding a column with the sheet name as you paste.
For either of these methods the important thing to do is build in a few checks on counts at the end to make sure your not missing any data.

User Interface to analaze date of a conventional rdbms

Currently we create Jasper PDF Reports from a single simple database table for our customers. This has been achieved programmatically. It's static. If the user wishes to change the query, he/she creates a change request, which we cannot deliver before the end of the next sprint (SCRUM).
The tool/library should be straight forward (e.g. convention over configuration) and employable from within a JavaEE container. And, open source.
Is there a dynamic tool that allows or customers to create the simple queries/reports themselves without knowing SQL? Means, they should be able to see the table and then create a query from it, execute and print (we could use Jasper Reports for the last one).
E.g. Select only data from year 2014, aggregate them by customer group and select columns x,y and z.
All of these criterias and query structure may change though, thus not just the value like year 2014.
Questions:
1) Is there a tool that presents the data in some kind of SAP-cube or something similar where the user could select the structure and attributes?
2) Can that tool save template queries (queries that the user has invoked before)?
thanks
With BIRT you could use parameters in the report... for example have one report that shows the whole data set or data cube (or at least a bit of all of the fields). Then you could add JavaScript to the report (or do all of the presentation in JavaScript for that matter), that shows the parameters a user can select from. These parameter values can then either be sent to a new report or could update the existing report. Parameters can be put into database queries too.
If that was exposed in JavaScript on a web page you could save the parameter values to an array and store them in the browser or server.

Tie stock quote value to cell in Excel 2011 Mac

I've been working on a mock stock portfolio in Excel, and I've been looking for ways to automatically update the data, eg. stock price and P/E ratio.
I have tried using a web query to MSN Money, but that just brings up the whole stock quote across multiple cells, I want data to be updated in individual cells only. The only web query solution I can think of is if someone hosted a website where each value in the stock quote was saved on a different HTML file. I could then WebQuery to that file for each cell requiring that value. However, no website offers this.
So in essence, is there any tool on Excel 2011 Mac that will let me pull individual values from a stock quote and assign them to a single cell?
You could consider the following:
For each stock, create a worksheet which contains a web query to that stock's web page.
Next, create a summary sheet, from where you link to the cells on the individual stock worksheets which contain the data you need.
Then, with 'refresh all connections' your data on the summary worksheet would update.

Resources