I have a query which is part of several queries in a tab.
I want to modify each of the queries by adding exclusions.
But when I copied the first query and put it in a new tab for testing, the table was underlined in red, and when you hovered over the text, it said 'Undefined table.'
Does anyone know why this would happen when the query is moved to a new tab?
I hadn't made any changes, yet!
The query looks like this:
SELECT
CONCAT ('DX COST',null) as "R List",
TRIM(T$SKU) as "SKU",
T$PDDP as "Price"
FROM TRITON.DDIITM001145
WHERE T$GSIZ NOT in ('LED','ODS');
The part TRITON.DDIITM001145 part of the query was underlined in red, when I copied the query and moved it into a new tab.
I've never seen that happen before?
Also, I'm not sure how to put the whole query in code, on here? I used the {} / code sample button to paste what you can see, but it didn't include the FROM statement?
Any thoughts would be appreciated!
Thank you!
In your new query tab, are you using the same database? Because our parser checks the data dictionary to see if it can find a view, table, or synonym called DDIITM001145
If we can't find it, you get the squiggly 'warning.'
This is ONLY a warning. It won't prevent you from running the query. It's just a heads-up that it might not work before you trying running it.
If you look at the Log panel, you can see where we query the database looking for your table.
Related
Hi I have been looking for some time to an answer to this but I really can not find one.
I have a dataset that is build from an S3 file.
this s3 file gets updated everynight and the dataset is refreshed soon after.
All the above works as you would expect. However if I want to add a field to the S3 file and see it in the dataset I can not seem to make this work.
I always get an error for every line of data that says INCORRECT_FIELD_COUNT
The documentation appears to suggest that adding a new field is fine so I assume there is something I need to do to make sure this works.
Any ideas?
I also posted here https://forums.aws.amazon.com/thread.jspa?threadID=346538&tstart=0
but after posting about 5 questions and never getting an answer on there I thought I would try here.
Thanks
Solution:
Edit your dataset
On the left you'll see a an "Excluded Fields" category (below the list of Fields). Expand it.
For each excluded field you'd like to include, click on the vertical dots and select "include field"
Save your dataset
Refresh your dataset to include the new fields
For the past couple of days, I have been trying to overcome a weird issue within Power Query in Power BI Desktop.
I have two tables, one is called the "Mappings" table, and the purpose of this table is to give me a column called "FMReference" after a bunch of transformations.
Mappings Screenshot
I have my main table called "Entry", which DOESN'T HAVE FMReference, and thus, needs to be merged with the Mappings table. To make the merge simpler, I have created a simple column on both tables named "CombinedForMerge". Entry Screenshot
After the setup for the columns are complete, I proceed to create a Left Outer Merge with the Entry and Mappings tables, using the columns I have just made. Left Outer Merge Screenshot
As you can see on the screenshot, the FMReference column says A4.28, which is what I am expecting on my results. However, once I expand that merge to give me the FMReference, I am getting a different value, A3.2! Wrong Value Screenshot
Power BI clearly cached the wrong value on PowerQuery, as I have filtered the Mappings table to JUST one row, to get JUST the one value. Filtered Mappings Screenshot
I have tried clearing the cache from the Power BI Options, but this didn't change anything.
I've also tried rebuilding the Power BI report from a clean, new PBIX, just copying the transformations up to this point, but I am still getting the same issue.
I've tried copying the results of the Mappings table onto a static table, and used it for the merge instead. This worked, which clearly means it is something to do caching on the data transformations on Power BI.
I've refreshed the Preview, as well as Refreshed ALL a few times, but it still returns the wrong result.
I would appreciate any help at this point, the data is very sensitive so I cannot share a lot, but I am happy to give more details if needed.
Thanks in advance!
I ran into similar inexplicably odd behavior when using fuzzy merge, set for an exact match. I wound up swapping the tables and using a Right Outer merge instead. For some reason, that worked. I have no idea what caused the problem or why the Right Outer merge approach worked though. It was quite odd.
So what I'm saying is: Instead of starting your merge from XXXXEntry and matching to XXXXMappings with a Left Outer merge, you might try starting from XXXXMappings and matching to XXXXEntry with a Right Outer merge.
One way to do that, if you still want the merge in the same place in the same query, is to just edit your existing query's code in the formula bar. To do that, click on the Applied Step that is associated with the merge, most likely called Merged Queries; then in the formula bar, swap the references to the tables and change JoinKind.LeftOuter to JoinKind.RightOuter. (One table reference will likely be the name of the Applied Step before your Merged Queries step, instead of XXXXEntry. For me, in the before and after examples that follow, it was #"Changed Type".)
Before:
= Table.NestedJoin(#"Changed Type", {"CombinedForMerge"}, XXXXMappings, {"CombinedForMerge"}, "Changed Type", JoinKind.LeftOuter)
After:
= Table.NestedJoin(XXXXMappings, {"CombinedForMerge"}, #"Changed Type", {"CombinedForMerge"}, "XXXXMappings", JoinKind.RightOuter)
Good luck.
When I issue a query like select * from city; using oracle sql developer in mac I get the output that is not aligned and it is very hard to read. How do I get the grid view and set it as default?
Sounds like you're getting the script output. You can have that formatted nicely by using SET SQLFORMAT ansiconsole, we'll make the columns line up as nice as possible based on the size of the display.
But if you want the data back in a grid, use Ctrl+Enter or F9 or the first execute button in the toolbar to execute.
This will get you the output in a grid, like this:
I talk about both executing as a script or statement here.
If your issue is with formatting, you may want to look at this link
If your issue is with records not getting inserted, please note these.
Records inserted in one session will not be visible in another session unless they are committed.
If you are checking the count in the same session where you inserted the records, then check for errors in insert. Add a show errors command at the end of your script, "path_to_file.sql" to check if any errors occurred while inserting the records.
Hope this helps.
We have a database with some fields that are varchar(max) which could contain lots of text however I have a situation where I only want to select the first for example 300 characters from the field for a paginated table of results on a MVC web site for a "preview" of the field.
for a simplified example query where I want to get all locations to display in the table
(this would be paginated, so I don't just get everything - I get maybe 10 results at a time):
return db.locations;
However this gives me a location object with all the fields containing the massive amounts of text which is very time consuming to execute.
So what I resorted to before was using SQL stored procedures with the:
LEFT(field, 300)
to resolve this issue and then in the Linq to SQL .dbml file included the stored procedure to return a "location" object for the result.
However I have many queries and I don't want to have to do this for every query.
This maybe a simple solution, but I am not sure how I can phrase this on a search engine, I would appreciate anyone who can help me with this problem.
You can use functions that directly translate to those functions too, this is useful when you need to translate code that functionally works just fine in SQL at no risk in LINQ.
Have a look at System.Data.Objects.EntityFunctions
Locations.Select(loc=>System.Data.Objects.EntityFunctions.Left(loc.Field,300))
This will get directly translated into a LEFT on the server side.
EDIT: I misread LEFT for LTRIM. Here's all the String functions that can't be used in LINQ to SQL. Have you tried String.Substring()?
Your best option is to map the stored procedure and continue using it. Here is an excellent article with screen shots showing you how to do so.
If you're not using the designer tool you can also call ExecuteCommand against the DataContext. It isn't pretty, but it's what we have for now.
I found something like this worked for me:
return from locationPart in db.locations
select new LocationPart
{
Description = locationPart.description,
Text = locationPart.text.Substring(0,300)
};
Not ideal because I have to use "select new" to return a a different object, but it seems to work.
I am trying to remove all references to a table from a Crystal XI report. Crystal is telling me that a column from that table is currently being used, because there is a little green check mark over the field in the field viewer. Also, if I try to remove the entire table, I get a warning. The warning is almost useless though because it doesn't tell me where the field is used. Now, back when programmers were real programmers, and mice were things cats chased, I could just grep a directory or file and find all references to a variable I was interested in. But how do I do this in Crystal? I have already tried exporting the report to a Report Definition, which helped find some instances of the troublesome field. Unfortunately, that format does not include all formulas, just some. Please tell me I don't have to buy a third party app (or write my own COM thingy) just to do this seemingly simple thing.
EDIT to add details about tangential point:
In case anyone is wondering, I am not crazy - I have duplicated the issue where a formula's definition does not show up in the exported Report Definition. I created a new blank report, created one formula named stealth that returns 1234. I then used that formula in the Section Expert for the details section, in the "suppress" formula, setting it to {#stealth} == 0. the use of the formula shows up, but not the definition. So when my unwanted column was used in the formula, I was not be able to find it! Here's what the rpt def looks like (after deleting some blank lines):
Crystal Report Professional v11.0 (32-bit) - Report Definition
1.0 File Information
Report File:
Version: 11.0
2.0 Record Sort Fields
3.0 Group Sort Fields
4.0 Formulas
4.1 Record Selection Formula
4.2 Group Selection Formula
4.3 Other Formulas
5.0 Sectional Information
5.1 Page Header Section
Visible, Keep Together
5.2 Page Footer Section
Visible, New Page After, Keep Together, Print At Bottom of Page
5.3 Report Header Section
Visible, New Page Before
5.4 Report Footer Section
Visible, New Page After
5.5 Details Section
Visible
Subsection.1
Visible, Keep Together
Format Formulas
Visible: {#stealth}= 0
If all else fails ...
File -> Export -> Export Report, then choose the Report Definition (TXT) option.
That will give you a plain-text representation of every element of the report. You can grep or CTRL-F or (insert search tool of your choice) through that. "Find in Formulas" usually works, but I've had to go the export route a couple of times, for no apparent reason.
Edit: Of course, if I'd bothered to completely read your post, I'd see that you've already done this.
Very curious.
If you right click on the field in Field Explorer and select Find in Formulas, it should bring up a dialog listing all of the places it is being used in formulas. On the left hand side of the dialog is a tree of all the possible places it could be, including oddball places like record selector and page formatting functions. Unfortunately, it does not seem to list running total fields.
EDIT: Oops, all the places it exists is listed at the bottom of the dialog; the tree view is the entire "DOM" of the report.
I know this is an old post, but...
Not knocking the Find in Formulas, it's been saving me today, but i was having trouble finding the last instance of the field. Even after all of the formulas and the droppings on the report were taken care of, I still had one lone use hiding somewhere.
I found it hiding as a Subreport Link. Right click on the Subreport -> "Change Subreport Links..." and there was the culprit. Dropping in this post because I figured someone else might have this problem too.
Fields can also sometimes be hiding within "Record Sort Expert"
Responding to an old post, but ran into a similar issue. I had a group based on the formula I wanted to delete that had a specified order. When I changed the grouping to a different field, the specified order remained. When I removed the specified order, my formula could be deleted.
This was tested on XIr2...
You change the tables datasource through the "set datasource location" dialog. Now, when it goes into the column mapping mode, uncheck match-type and pick a new column that would cause an error in a formula. (i.e if the column you're looking for is a string replace it with a datetime column). Go to the preview and you should get an error box like "A string is required here.", close that error and up pops the offending formula!
One more suggestion. After following a lot of the suggestions here, my report was still telling me the formula was in use. I had to close the report. When I opened it again, the check mark was gone and it let me delete it. This was on Crystal v 11.0.0.1282
In my case the Formula Field happened to be part of an old Running Total Field, which itself was not included in the report. Once I deleted this old Running Total Field I could delete the unused Formula Field.
Very late, but i use CR 2008 (12.3.0.601) and just today (6/16/2015) i am trying to document only the formulae of my report. I knew about exporting the Report Definition, and Finding a Formula in all Formulae. But there are about 50 Formulae. I discovered that the exported Report Definition didn't document all of my Formulae, but I didn't bother to uncover the logic behind that; instead, i plopped all Formulae into a section, then exported the Report Definition. Voila. Of course, i still need to cull all the unnecessary definition elements. But at least i have all Formulae.
So with all the great selections.. I still had one instance hiding from me. I found out where it was by creating a clone of the data table and renaming\deleting the field.
I then used the "Set Database Location" as suggested above to point to my new table. It did error out when it could not find that field but still didn't tell me where it really was (it just said report field).
I did NOT map it and clicked continue which deleted the field from the report. I then mapped it back to the real table and I was good.
In my case, there was a Chart, and the field was being used as one of the "on Change" fields.
Although an old post, this functional gap still exists within Crystal Reports itself. We have a fully functional 14 day trial of our third party software that uses the latest Crystal.net API to search for plain text within a library of Crystal RPT files in one fell swoop. Also searches the data saved within reports, and text within labels ... as well as datasource behind all your reports ( stored procedures, views, and table data ) with support for SQL Server, SQL Azure, MySQL, Oracle, Amazon RDS, DB2 and Access.
More info and trial downloads at http://www.finditez.com
Note, you will need to download and install the compatible SAP Crystal.net runtime connector for searching your RPT file library.