Alteryx Unknown Variable - variables

i have a problem with alteryx. The problem is that although I have Score_Yes column in the input of Score, I get unknown variable error. Could you help me?

The Summary tool will only output the grouping variables and aggregate variables selected in its configuration. You probably lost [Score_Yes] at that stage.

Please try below option
1. identify from which table Score_yes is flowing, then convert the value of Score_yes to numeric

Related

REPLACE NULL IN SSIS Derived Column

I have an SSIS package which transfers data from SAS to SQL Server. I'm creating a derived column but cannot get the REPLACENULL feature to work. I am receiving the error
"Invalid character value for cast specification"
which I am sure is because of NULL values in the source. Here is my current derived column expression:
REPLACENULL(DATEADD("d",(DT_I8)AuthEndDate,(DT_DATE)"1960-01-01"),0)
The REPLACENULL function isn't working here. Any way that this can be done? I am using SSIS 2008. Thanks.
Since you want blank/0 to flow downstream you need an if, not a replacenull()
Please note blank/0 in SQL Server writes as 1900-01-01, blank/0 are not valid date values, so it defaults to this. The only other option is NULL.
This should work if the destination is a datetime column:
ISNULL(AuthEndDate) ? (DT_DATE)0 : DATEADD("d",(DT_I8)AuthEndDate,(DT_DATE)"1960-01-01")
If you opt to write NULL instead of 1900-01-01, you can do this:
ISNULL(AuthEndDate) ? NULL(DT_DATE) : DATEADD("d",(DT_I8)AuthEndDate,(DT_DATE)"1960-01-01")
You must use one of the following expressions:
DATEADD("d",(DT_I8)REPLACENULL([AuthEndDate],0),(DT_DATE)"1960-01-01")
OR
ISNULL([AuthEndDate]) ? (DT_DATE)"1960-01-01" : DATEADD("d",(DT_I8)AuthEndDate,(DT_DATE)"1960-01-01")
Note that you cannot use a logic that can return multiple datatypes, both cases must return on datatype (DT_DATE)
If the source is returning NULLs, then try a REPLACENULL at AuthEndDate rather than after the calculations. The statement you have will try to do calculations with NULLs which is never good.
So...
REPLACENULL(DATEADD("d",REPLACENULL((DT_I8)AuthEndDate,0),(DT_DATE)"1960-01-01"),0)
Edit - replacenull and then apply conversion:
DATEADD("d",(DT_I8)REPLACENULL(AuthEndDate,0),(DT_DATE)"1960-01-01")
You won't need the first REPLACENULL anymore since we now handle it before the calculations.
Therefore:
DATEADD("d",REPLACENULL((DT_I8)AuthEndDate,0),(DT_DATE)"1960-01-01")
Edit: You can change the 0 to whatever you want the NULL to become, 0 was a placeholder.

Column sorting in SSRS report

I want to sort my column numbers at report level in SSRS instead of my query as I have some other columns sorted at query level and doing both sorts at query level don't work well. At the moment I get Columns order like 1, 10,2,3,4,5,6 instead of 1,2,3,4,5,6...10.
Once sorting is done I also want to add 'sales_' to the column name so I see sales_1, sales_2, sales_3 and so on. I understand this could be pretty straightforward but I'm new to SSRS. Thanks in advance.
The sort you are describing (1, 10,2,3,4) is a string sort, you need to convert the data type on that column to a numeric (in this case integer) type so that the sort is correct.
There are two solutions to this, you can add a calculated field to the record set, this can be helpful if you need to use this column multiple times, or you can simply use an expression for the sort order.
Right click on your dataset and select Add Calculated field, a dialog will open with all the column definitions for the query, here you can add your own custom fields.
For a custom field you will need an expression, which was the other options originally, so lets have a look at that component.
Edit the sort definition for the Tablix or group and select the field you want to sort on, to sort the way you would like the value needs to be numeric, we can use the CInt function to convert a value to an integer
NOTE: when using expressions to convert data types, if your data might not be convertible you may need to validate the value before conversion otherwise your
report execution will fail. The error messages are pretty helpful though and the expression dialog shows available functions an examples of usage for each of them.
For your second issue, use an expression in the field where you are displaying the data to concatenate the values, you can use the String.Format function or you can use simple string addition:
Expression Examples:
="sales_" + Fields!ItemValue.Value
="sales_" & Fields!ItemValue.Value
=String.Format("sales_{0}", Fields!ItemValue.Value)
I hope this helps you on your way, welcome to SSRS!

LONG column value

I am having an issue with attempting to import data from an excel csv file. I am using SQL Developer 4.1. My problem is I keep getting an error of:
ORA-01461: can bind a LONG value only for insert into a LONG column
despite the fact that I am not using a LONG column. That is not even an option for me to use. I am only using varchar2, number, and date. Can somebody assist in explaining what the LONG thing is, and how I can get around it? And yes, I am aware of how stupid this sounds.
I think the problem is the other way around, i.e. you are trying to enter a number into the number column that is too high. The Datatype is defined here https://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT1832

Null check on decimal crystal reports using CDBL({value})

I am using a decimal value in a formula which gives error when there is no data.
I tried using CDBL({value}) i.e. create a formula for value=CDBL({value}) .
The use {#value} in the formula. This used to take care of null values. But now keep getting error IF NOT ISNULL({#Value}) THEN ' A number, or currency amount is required here. Details: errorKind
Any suggestions on how to fix this please
I will try to answer this and see if I get any sort of indication that it worked.. maybe even a correct answer indication :)
You cant have mixed field types returned in Crystal. If one part of the IF statement returns a numeric type then the rest has to be numeric type. If you post your entire formula I (or someone else who is willing to give up valuable time) can show you how it needs to look.

How to resolve Oracle error ORA-01790?

I have two select statements joined by "union". While executing that statement I've got:
Error report:
SQL Error: ORA-01790: expression must have same datatype as corresponding expression
01790. 00000 - "expression must have same datatype as corresponding expression"
Maybe you can give me an advise on how to diagnose this problem?
Without looking at your SQL, I would guess that you have columns being UNION'ed that have different data types.
Here's what found:
ORA-01790: expression must have same datatype as corresponding expression
Cause: A SELECT list item corresponds to a SELECT list item with a different datatype in another query of the same set expression.
Action: Check that all corresponding SELECT list items have the same datatypes. Use the TO_NUMBER, TO_CHAR, and TO_DATE functions to do explicit data conversions.
I haven't seen your query, but I am guessing that one select in your union is not selecting the same columns as the other.
Clearly the issue for the poster was solved over half a decade ago, nonetheless I wanted to point out to anyone reading this post in search of help that the order of the selected properties (columns) must match from one unioned statement to the next. It is not enough to simply have the names and the data types match, though that is in a sense the root cause. But due to the way the Union statements are handled in Oracle, it is possible to get the ORA-01790 error due to a mismatch in the ordering of columns only.
In my case, I had a query with a UNION ALL of two selects. One select had a column named "generic_column_name" as the 25th item in the select, and the other select had that same column named "generic_column_name" of the very same data type (I tested several ways through hard coding and also using forced data type conversions). However the second select had this item in the 19th place, so all of the columns from there on were offset and this triggered the ORA-01790 error.
As I mention in the question I'd like to have SUGGESTIONS for how to troubleshoot my problem.
What I've done is enabled one column at a time in each select statement and found that I had mismatch at the very last column of my SQL UNION. Thanks a lot for participating and helping me, but I knew I had type mismatch, WHAT I didn't know is how to troubleshoot.
The error is telling you that you're union-ing columns with different datatypes. There are oracle functions that will convert one type to another (e.g. "to_char"), you'll have to convert the datatypes into a common format, or at least one into the other. If you post the actual query/types it'd be possible to be more specifc.
You need to make sure that corresponding columns in your union have the same data type. The easiest way would be to comment out columns one by one to narrow down to the column and then use explicit type conversion function in one of them to make types match.
You tried to execute a SELECT statement (probably a UNION or a UNION ALL), and all of the queries did not contain matching data types in the result columns.
Techonthenet - ORA-01790
I had the same problem today. The issue is in the union, basically in the order of the columns