Failed to create field with CASE WHEN statement and aggregation - google-data-studio

I have this calculated field in Google Data Studio:
Field Name: new_users_android_minus
Formula:
MAX(CASE
WHEN is_new_user>=1 AND platform="ANDROID" THEN 0
ELSE 1 END)
When I try to make a copy of this formula to a new field, or even when I try to update the existing field just adding a white space, I get this error:
Failed to create field. Please try again later.
In other words, the report and the field are working perfectly, but I can't update the existing field or use this formula in a new field. I'm facing this behavior with many fields where I use CASE WHEN inside aggregations MAX() and COUNT_DISTINCT(). Sometimes it works, sometimes not.
Is this a bug in Google Data Studio, or am I missing something?

Related

How do I achieve this output in a Google Data Studio report, given the raw data?

I have a small set of test records in Google Data Studio and am attempting to create a table that gives me breakdowns of particular values relative to the total number of values, by dimension. I think the image here below describes the need clearly. I have tried using an approach I saw online entailing creating a calculated field like this:
case when Action = 'Clicked' then 1 else 0 end
and then creating a metric based upon that field, which does the 'Percentage of Total - Relative to Corresponding Data' but this produces incorrect numbers and seems really cumbersome (needing one calculated field per distinct value). My client wants this exact tabular presentation, not a chart(s).
How do I achieve the desired report?
Thanks!
Solution entails creating fields like 'Opened' which outputs 1 when Action = 'Opened', 0 otherwise. Then create fields like 'Opened Rate' with e.g. sum(Opened) / Record Count. Then set those as percentages.

Salesforce Report Formula

I am trying to create a report to show employees without something. I have a report type "with/without" that is connecting 2 objects. 1. contact 2. observations
The observation.date__c is the date of the observation. If a contact has not had an observation, the observation.date__ displays "-"
I am trying to either group by this field or replace the "-" with other text.
I have tried to bucket this field, isnull, isblank, if greater than, etc but nothing seems to be working. I get an error saying that I can not use observation.date__c because it is an object.

How do i solve this SISS thing?

TITLE: Microsoft Visual Studio
Error at Data Flow Task [Union All [303]]: The metadata for "Union
All.Inputs[Union All Input 3].Columns[Title]" does not match the metadata for
the associated output column.
Error at Data Flow Task [Union All [303]]: Failed to set property
"OutputColumnLineageID" on "Union All.Inputs[Union All Input
3].Columns[Title]".
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0204006 (Microsoft.SqlServer.DTSPipelineWrap)
BUTTONS:
OK
I keep getting this error when i try to do data conversion and then try to do union... This is because, if you know, the data conversion, will create new columns. SO when i try to do union with them, it will get the bove error.
you have to delete and re-add those connections between sources and union.
I had the same problem once and what I did was as follows:
1)Double click the respected data-conversion which faulty data is passing through
2)Check to see if all the data types for you columns are matching with the data type of same column from your other data-conversion.
3)Fix if there is any difference
And this will fix it for you, as it did for me.
Double click the UNION ALL component to display the output Column Names.
Change Union All Input 1 and the Union All Input 2 to
Rename you column and add a new column with the right name and the right data.
Now you have the right column with the right types,you can delete your old renamed column.
Don't forget to update the derived column and destination compnenent. The will be updated automatically with the unwanted renamed column. Just configure the right column in these component and refresh. all will be right.

MS ACCESS Report - Using CODE to change a value in a field from an OPTION Group to a different value

I have a report in ACCESS that Is based on a query of a table populated by a form with an Option group. ( to try to explain this better - Table is inspector qualifications, the query pulls all of the qualifications for the inspector, the qualifications are selected via option group on a form that populates the fields of the inspector qualification table.) Of course, the choices are stored as numeric values, "1, 2, 3 or 4" in the table, but 4 actually designates a N/A or NONE. Since everything is already built out this way, I am trying to write a code that will run when the report is generated (or opened,) that will take the "4" value entered (if the field equals that) and change it to a Null value /blank in the report - not in the query or table. I still want this report to generate everything else as is - show all records - just change the value if that particular option is the one shown in that field for that particular record.
Anyone know of a good way to do this? Any help would be GREATLY appreciated!!!!
You would just place an 'IIF' in the query that tests for the value you want to change, then either changes it to something else, or retains the original value. The below will test field 'Nbr1' for the presence of a 4, and if found, change it to 'N/A', otherwise it stays the same.
Note! You will need to change the control source in the report to reflect the name you provide (i.e. 'MyChange') because you can't keep the original name.
SELECT Table1.ID, Table1.EMPID, Table1.TestResult,
IIf([Nbr1]=4,"N/A",[Nbr1]) AS MyChange, Table1.Nbr2
FROM Table1;

Conditional If statement within table visual basic database (T-SQL)

I would like to create a column that displays if a student has passed or failed. To pass the overall grade needs to be above 40.
I have done this before using access using the following:
IIf([Overall]<=40,"fail","pass")
But I’m very new to visual basic. Anyone got any ideas on how I can do this?
The IDE I am using is Visual Studio
This is the table
Or if there are any tutorials that you would recommend that would be great.
You can do it in your table definition:
You can use a CASE WHEN statement to check for a criteria and provide a value.
You can not refer to a computed column in another computed column.
So you can add a column like this:
[ColumnName] AS CASE WHEN (the formula for overall) <= 40 THEN 'fail' ELSE 'pass' END
Also you can make the result as a bit (boolean) data type and let the application decide to show a string instead of true or false.

Resources