i'm trying to use the ApplySimple function in order to define a Metric in MicroStratey. My gloal is to cast a fact column to double value.
My current metric definition is:
ApplySimple("TO_DOUBLE(#0)", MYFACT)
The syntax check reports a wrong expression and indicates the error by marking the comma.
I tried to remove the MYFACT parameter including comma, but the syntax check fails as well, indicating the error on right parenthesis.
ApplySimple("TO_DOUBLE(MYFACT)")
Any suggentions on how to correct the syntax?
Thank you very much!
Kind regards
Okay, just got the problem. You have to use ";" insted of "," after the expression.
Related
I am currently running an aggregate function and I get :
Error n° 10933 in column 1. Text: DATASET
The definition of a new variable on the AGGREGATE command must be
terminated by a slash.
This command not executed.
I want to have the fertility ratio (Child-Woman ratio) from a 1911 census. Here is my syntax (I added the spaces here):
Screen shot of the syntax here
I just don't understand why it cannot go through and adding slashes does not help either.
I seems to be a very banal error.
Does anyone have any advice ?
Thank you !
SPSS commands should be ended with periods. Your syntax treats the DATASET ACTIVATE as a continuation of the AGGREGATE command, and the parser thinks "DATASET" is a new variable. Put a period after the closed parentheses to finish the command.
I just got an error about an unexpected token while using the NiFi expression language.
'prod' validated against ${hostname:contains("prod")} is invalid because
Unexpected token ':' at line 1, column 10. Query: ${hostname:contains(prod)}
In this case the problem occurs in the RouteOnAttribute processor.
My question: What is/are the typical causes of this error?
Of course it is good to check the actual expression, however in this case I did not find any problems with the expression.
The problem comes from hostname
As documented here:
There also exist some functions that expect to have no subject. These functions are invoked simply by calling the function at the beginning of the Expression, such as ${hostname()}
After this it was quickly fixed by calling my attribute host_name instead.
I'm trying to add a filter with IN operator to my tablix. Problem is , my criteria values are already comma separated like A,B and C,D. Writing them like " 'A,B','C,D' doesn't seem to work.
I couldn't manage to get the filter working and all other questions/examples are for single word criteria. Any help?
I managed to fix this issue on my own by using a =split("2B,2C",",") function and changing the split notation (the last ,) to something other than a comma. Works very fine.
I hope this would help and save time for other people in future.
I want SQLAlchemy to generate the following SQL code:
SELECT t171 AS "3Harm" FROM production
I've been playing around with something similar to this SQLAlchemy ORM snippet:
session.query(Production.t171.label('3harm'))
The problem here is that this doesn't properly quote "3harm" in the generated SQL. Instead of "3harm" this generates the unquoted 3harm, which is invalid because it starts with a numerical character and therefore raises the following Oracle exception:
ORA-00923: FROM keyword not found where expected
I can get this to work by capitalizing any character in the alias name:
session.query(Production.t171.label('3Harm'))
But I would still prefer to use all lowercase column names since the rest of my program is standardized for all lowercase. Any idea how to force quote the lowercase version?
Found the solution while looking for something else.
Any column can be forced to use quotes with column.quote = True.
So for the original example:
column = Production.t171.label('3harm')
column.quote = True
session.query(column)
Success!
The SQL you want to generate isn't valid; rather than this:
SELECT t171 AS '3Harm' FROM production
... you need the identifier to be enclosed in double quotes, not single quotes:
SELECT t171 AS "3Harm" FROM production
So it looks like you should be able to do this:
session.query(Production.t171.label('"3harm"'))
or maybe:
session.query(Production.t171.label("3harm"))
But I don't use SQLAlchemy and I don't have any way to check if either is valid; you might need to escape the double quotes in the first one, for instance, though from this perhaps the second is more likely to work... and I don't understand why 3Harm would work unquoted.
I got the following regular expression:
=([^"]*)
Basically I want to extract a value between = and " (example: "City=Paris", output "Paris"). But for some reason this expression wont work in PowerCenter.
You got any idea how to implement it?
Thank you
Thomas
You can try this
REG_EXTRACT('"City=Paris"','(.*\w+=)(\w+)(".*)',2)
This basically breaks up the string in three groups of characters and returns the second group.