I have a sheet with a lot of columns that I use as parent feed for my eCommerce shop. It has columns like; price, availability, title, description, etc.
As I need to customize this feed for different services (they ask me less values in a clean sheet). I got some sheets with the columns I need, so I can call them like: =Sheet1!B2"
Now, I got to format this data, because for example, in some services, availability should have a value like, "in stock", and in others its just... yes/no.
How can I do something like:
IF (Sheet1!B2 == "in stock") then
show "yes"
else
show no.
Your question is unclear - are you looking for a formula or a script? Do you have an example of your data and the expected output you could show to us?
If you are looking for a formula, this should do the trick:
=IF(Sheet1!B2="in stock","yes","no")
Related
I'm working with Google Analytics and i've come across a (not set) issue with Content Grouping. I changed my URL's in the month of August, and then most of the URL's went into the (not set) Content Grouping, instead of its specific group. Is there anything I can do to have the URL's put back into their correct grouping?
Also, i'm reporting out this data via Data Studio and I was wondering if there was a query/filter that I could use to have it be grouped into the correct content grouping?
The content groupings you have probably was dependent on the URL. You will need to modify your existing content groupings in GA and change the rules so that it matches the new URLs.
As for reporting in DataStudio, you can use CASE functions in a new calculated field. The cases will be the rules for your content groupings. Example:
CASE
WHEN REGEXP_MATCH(page, "(mypagepath1|mypagepath2|mypagepath3)") THEN "Group 1"
WHEN REGEXP_MATCH(page, "(mypagepath4|mypagepath5)" ) THEN "Group 2"
ELSE "No Group"
END
After that you will use the new calculated field in place of the content grouping dimension.
Welcome to StackOverflow. As #Sonali has already implied, you need to take into account the fact that GA is incapable of setting an 'if not set, use default' value on a dimension. If you can see any way of better interpreting the August data you do have, try using the GA plugin in Google Sheets: if you do that, and then use a Sheets formula to manipulate the data, you can then have GDS access the sheet.
I am trying to join data associated with two custom variables in the same Google Analytics dataset for a filter widget. We have institution names for older data in customVarValue2 and after GA changed the use of custom variables, newer data in Institution. I would like to be able to access all that data (back to October 2011) in one pageview chart and I think I can do that with a calculated field.
I saw on a post in the Data Studio forums that the logical operators don't work so I've been trying to do this with individual lines like so:
CASE
WHEN REGEXP_MATCH(customVarValue2, '.*Denmark.*') THEN 'Denmark!'
WHEN REGEXP_MATCH(Institution, '.*Denmark.*') THEN 'Denmark!'
ELSE 'Other'
END
The goal is to end up with one "Denmark!" field in the widget dropdown where all the data is combined from the two custom fields (customVarValue2 and Institution) to cover the whole date range. I can get it to work with one of the variables and it gives me the choice of "Denmark!" and "Other" with the appropriate date range for the custom variables that I used. But when I put both "WHEN" cases in, I only get "Other" showing in the widget dropdown. I would appreciate any advice you can give.
Thanks,
Sandy
The version below seems to work for me on a different case. Have you checked the case of the custom variable macthes?
CASE
WHEN REGEXP_MATCH(customVarValue2, '.Denmark.') OR REGEXP_MATCH(Institution, '.Denmark.') THEN 'Denmark!'
ELSE 'Other'
END
I'm trying to get list of Chinese universities and their adresses. The minimum being the City/Town name. I will use these addresses to populate a googlemap, fiddle here.
I saw interesting code such as:
SELECT ?resource ?value
WHERE {
?resource a <http://dbpedia.org/class/yago/CitiesAndTownsInDenmark> .
?resource <http://dbpedia.org/property/populationTotal> ?value .
FILTER (?value > 100000)
}
ORDER BY ?resource ?value
Since CitiesAndTownsInChina doesn't work,
1. Where to find the exact name of the class I'am targeting ? and
2. Where to find dbpedia's operators manual ?
Note: I'am a very active user on Wikipedia, I'am well aware of all the data available there, but the dbpedia ontology/syntaxe/keywords is quite hard to get.
Personal note: queries on http://dbpedia.org/snorql/ , http://dbpedia.org/sparql/ , http://querybuilder.dbpedia.org/
(Expanding on my reply to How to find cities with more than X population in a certain country)
CitiesAndTownsInDenmark exists because people use the category http://en.wikipedia.org/wiki/Category:Cities_and_towns_in_Denmark in wikipedia. Wikipedia categories are pretty loose and as a result there's a lot of variation in style, so even if a useful category exists the name may not be guessable.
In addition categories are maintained manually, and may not be consistently applied.
A good place to start is looking at the data. Visiting http://dbpedia.org/page/Beijing I see yago:MetropolitanAreasOfChina which seems promising, but if you follow that link you'll see it's not well populated.
As a consequence avoid relying on the existence of such categories and directly querying for populated places in a country. This information comes from wikipedia infoboxes, and they're much more consistent than categories. Taking Beijing as an exemplar again I found:
select ?s {
?s a <http://dbpedia.org/ontology/PopulatedPlace> ;
<http://dbpedia.org/ontology/country> <http://dbpedia.org/resource/China>
}
(The relevant properties and values for my query were found by copying link location in the Beijing page)
with the result:
"http://dbpedia.org/resource/Hulunbuir"
"http://dbpedia.org/resource/Guangzhou"
"http://dbpedia.org/resource/Chongqing"
"http://dbpedia.org/resource/Kuqa_County"
"http://dbpedia.org/resource/Changzhou"
... nearly 3000 results ...
You'll notice that position is encoded multiple times (geo:lat and long, georss:point, various dbpprop:latd longd things), and there seem to be two values excitingly. You can either simply deal with the multiple values in whichever format you prefer, or try picking just one using GROUP BY and SAMPLE.
As for a manual, almost everything I know of are academic papers, and not very useful. However the data is reasonably self documenting.
for your first question:
you can see possible classes by querying one member of your intended set of entities (ex: Shanghai).
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?type WHERE {
<http://dbpedia.org/resource/Shanghai> rdf:type ?type.
FILTER regex(str(?type), ".*China", "i").
} LIMIT 100
which gives this result:
dbpedia:class/yago/MetropolitanAreasOfChina [http]
dbpedia:class/yago/PortCitiesAndTownsInChina [http]
dbpedia:class/yago/MunicipalitiesOfThePeople'sRepuBlicOfChina [http]
dbpedia:class/yago/PopulatedCoastalPlacesInChina [http]
they are CamelCase versions of the categories that you will find at the bottom of wikipedia pages. I was fooled for a while by the erroneous capitalization of RepuBlic and finally saw that it contains only 4 cities, so it is of limited use for you.
so I would propose to go with #user205512 answer and get the cities by linking 2 properties.
for your second question:
I would advice you to search/ask on http://answers.semanticweb.com
I have a report which contains 10 columns of stock values.
When a stock value is negative I would like the text in my report to be formatted differently, for example I may wish to format it in Bold & Red.
Is this something I need to do in the fetch method?
At the moment my fetch method is very basic, just using setRecord once to setup a temporary table.
Is it possible and if so how is it done?
Take a look on the tutorial_ColourLines report.
reportSection.foregroundColor(colour);
The report changes the color of a report section, but it can be done to individual report controls as well.
I need to create a donor summary report that provides total donations by donor by year.
I need to provide
name address email yr1total yr2total etc...
It looks like salesforce only allows two columns in row headings and two columns in column headings. Is there a way to work around this
Or, is there a way to use the tabular report to do the same?
TIA
If donations is a single field on the donor's record, it seems like what you're looking to do is attempt to display two columns for the same data within a report. The best way to do this (well, outside of creating a master-detail relationship with a new custom object named "Donations") would to have formula fields for each of the donation years, and calculate the donation sums in each of them. That is, as long as you have a way of calculating the year of the donation.
I believe to get the best answer, more information is needed.
Something like this? This will work if your donation is a separate object that's linked to Account (I've used Tasks & Events linked to Accounts in my example).
Create a report in "Matrix format".
Drop Account Name on the left pane, Donation's Date on the columns.
Columns will default to days. Click the dropdown in the place where I have "Created Date" and select summarizing by year (of course fine-tune to whatever you need).
Check date ranges / filter criteria etc obviously if you don't see all data.
Click Show -> Hide details.
Drop your "Donation Amount" or similar field into place where "Record Count" is displayed. Use "Sum".
Optionally deselect Show -> Record Count.
Now you're mentioning that there are only 2 columns so you probably already tried this. Well, common trick is to cheat by using a formula field that would hold your data (separated by comma maybe?). Tabular report would require you to create some helper fields (1 per year) on Account and do some kind of rollup summaries, messy.
If it's for a dashboard you could play with summary report (it can have more groups than 2) and pick chart type table on the dashboard...