how to highlight errors (false fields) in power query? - highlight

Here is the task:
Automatically check the quality of data in specific columns as per rules described in the table below. If possible, use color coding to emphasize False fields but if not possible, other options are acceptable. The main idea is to make errors in data visible.
Any ideas how to color code these false fields or other option of making errors visible in Power query? Checking the quality of data with IF functions, and the False part should be visualised.
THANKS

You can't adjust color in the query editor. Errors might stand out more than False though.
Here's an example of what Errors compared to nulls looks like:

Related

want to name the formula in drop down list

in my original workbook i want to display some values from another sheet for multiple actions.. so i put drop down list for each actions. but when the actions increased i couldn't recognize each formulas. (all of them are import range) so that if i can name each formulas in the drop down then i can recognize fast which action to be performed. here a sample sheet is attached for a solution.. pls take a look. in the dropdown list i included (=a2+b2) instead of that if it displayed as addition in drop down list would be help ful. please take a look.
sorry for my english
Any type of help would be appreciated.
https://docs.google.com/spreadsheets/d/1mpIWyQASMlxRVdlTkv9K1e4oihsrckjT6sD1mLDxvEc/edit#gid=0
If I understand correctly, you want to have a dropdown list menu (from Data Validation) that displays the operation name, but when you click it, it displays just the result.
This is very hacky, but here's a way to create some "labels" in your criteria box:
=IF(;"ADDITION";A2+B2),
=IF(;"SUBTRACTION";A2-B2),
=IF(;"DIVISION";A2/B2),
=IF(;"MULTIPLICATION";A2*B2),
How?(!)
After kicking around some no-op ideas, I finally settled on this as the cleanest and most flexible approach. (By some freak coincidence, it also makes some semantic sense too.) It works because when the first argument to IF is omitted, it defaults to 0 -> FALSE. This effectively makes the second argument to IF a comment/no-op, and always just selects the formula.
Yes, the semicolons are intentional or the parser will think of the args as list items.
Productivity Tip/Footnotes
Sheets will remove any line breaks in your validation criteria, so the formula will be hard to read when you have to edit it. If you anticipate that you'll be adding a bunch of functions later, save the above block in a text file and edit that. Then you can copy+paste it into the validation field.
It will also always show up as "INVALID" because the value will of course never match the formula text.

Data Validation, Complex, based on another sheet

Sample sheet here.
Have 2 sheets; DataTemplate stores the validation keys and DataValidation is the sheet that should include data validation based on said keys.
Eg: DataValidation!B11:E17 is validated against DataTemplate!B11:E17 (please see sample)
Sample validation requirements:
IF coressponding DataTemplate value == -500 then Cell must be blank
IF coressponding DataTemplate value == -200 then Cell must be blank or positive number
IF coressponding DataTemplate value > 0 then Cell must be a number between 0..1 OR a string in [ "A", "B", "C" ]
I've attemped this with formulae like below but other than very simple validation available on the net, I've not been able to make anything work.
=SWITCH(INDIRECT("DataTemplate!D11:E17"),-500,ISBLANK(D11),-200,OR(ISNUMBER(D11),ISBLANK(D11),OR(ISNUMBER(D11),IFERROR(MATCH(D11,SPLIT("A,B,C",","),FALSE),FALSE)>0)
EDIT; solved thanks to Jeremy Kahan (below).
My issue was, I was trying to apply Conditional Formatting rules to Conditional Validation, but apparently they are quite different in terms of their application (I do believe). Eg: you can directly access cells in other sheets, you write a normal formula for the top left cell of the range you are applying to. My actual validation formula is given below.
=SWITCH(WorkArrivals!D11,
-500,ISBLANK(D11),
-400,ISBLANK(D11),
-200,AND(NOT(ISBLANK(D11)),OR(AND(ISNUMBER(D11),D11>0,D11<1),NOT(ISERROR(SEARCH("|"&D11&"|","|absent|sick|annual|family|domtravel|inttravel|"))))),
-100,OR(ISBLANK(D11),AND(ISNUMBER(D11),D11>0,D11<1),NOT(ISERROR(SEARCH("|"&D11&"|","|domtravel|inttravel|")))),
AND(NOT(ISBLANK(D11)),OR(AND(ISNUMBER(D11),D11>0,D11<1),NOT(ISERROR(SEARCH("|"&D11&"|","|absent|sick|annual|family|domtravel|inttravel|")))))
)
Tips:
No way to validate NOT(ISBLANK()) as (it appears) validation is triggered when data is entered ONLY.
Similar to Conditional Formatting, it appears that the whole (applied) range is validated and NOT just the cell that was updated. There is a (background active progress bar) lag (~2s for range(1000 rows, 15 cols) - so use with caution on large ranges. #Google could make this smarter ?
Solved thanks to Jeremy Kahan (below). For the benefit of other users;
My issue was, I was trying to apply Conditional Formatting rules to Conditional Validation, but apparently they are quite different in terms of their application (I do believe). Eg: you can directly access cells in other sheets, you write a normal formula for the top left cell of the range you are applying to. My actual validation formula is given below.
=SWITCH(WorkArrivals!D11,
-500,ISBLANK(D11),
-400,ISBLANK(D11),
-200,AND(NOT(ISBLANK(D11)),OR(AND(ISNUMBER(D11),D11>0,D11<1),NOT(ISERROR(SEARCH("|"&D11&"|","|absent|sick|annual|family|domtravel|inttravel|"))))),
-100,OR(ISBLANK(D11),AND(ISNUMBER(D11),D11>0,D11<1),NOT(ISERROR(SEARCH("|"&D11&"|","|domtravel|inttravel|")))),
AND(NOT(ISBLANK(D11)),OR(AND(ISNUMBER(D11),D11>0,D11<1),NOT(ISERROR(SEARCH("|"&D11&"|","|absent|sick|annual|family|domtravel|inttravel|")))))
)
Tips:
No way to validate NOT(ISBLANK()) as (it appears) validation is triggered when data is entered ONLY.
Similar to Conditional Formatting, it appears that the whole (applied) range is validated and NOT just the cell that was updated. There is a (background active progress bar) lag (~2s for range(1000 rows, 15 cols) - so use with caution on large ranges. #Google could make this smarter ?

Column Order with ui-grid-grouping

i'm struggling with the Ui-Grid. I am using the grouping option to group my results. This works pretty fine, but in the documentation of this feature Grouping you can find the following statement:
Optionally (and by default) grouped columns are moved to the front of the grid, which provides a more visually pleasing effect. In order to avoid creating a dependency on pinning, this is done by moving the columns themselves as part of the grouping feature, not through use of the pinning feature.
My understanding is, that it would be possible to disable this behavior. But i am not able to find how i can do so.
I want to have an action-column in the front of every entry.
Can anyone tell me how i disable the behavior that the "grouped" columns are always the first in the grid?
Thanks in advance
Found it out by myself:
You need to set the value "moveGroupColumns" to false
This value belongs to the gridOptions object

SPSS Frequency Plot Complication

I am having a hard time generating precisely the frequency table I am looking for using SPSS.
The data in question: cases (n = ~800) with categorical variables DX_n (n = 1-15), each containing ICD9 codes, many of which are the same code. I would like to create a frequency table that groups the DX_n variables such that I can view frequency of every diagnosis in this sample of cases.
The next step is to test the hypothesis that the clustering of diagnoses in this sample is different than that of another. If you have any advice as to how to test this, that would be really appreciated as well!
Thanks!
Edit: My attempts:
1) Analyze -> Descriptive Statistics -> Frequencies; then add variables DX_n (1-15) and display frequency charts. The output is frequencies of each ICD9 code per DX_n variable (so 15 tables are generated - I'm hoping to just have one grouped table).
2) I tried adjusting the output format to organize by variable and also to compare variables but neither option gives the output I'm looking for.
I think what you are looking for CTABLES. It can do parallel columns of frequencies, and it includes a column proportions test that can see whether the distributions differ
Thank you, JKP! You set me on exactly the right track. I'm not sure how I overlooked that menu. Just to clarify in case anyone else comes along needing to figure this out:
Group diagnosis variables into a multiple response set using Analyze > Custom Tables > Multiple Response Sets. Code the variables as categories.
http:// i.imgur.com/ipE9suf.png
Create a custom table with your new multiple response set as a row and the subsets to compare as columns. I set summary statistics to compute from rows and added the column n% column (sorted descending).
http:// i.imgur.com/hptIkfh.png
Under test statistics, include a column proportions z-test as JKP suggested.
http:// i.imgur.com/LYI6ZRl.png
Behold, your results:
http:// i.imgur.com/LgkBA8X.png
Thanks again, and best of luck to anyone else who runs across this.
-GCH
p.s. Sorry everyone, I was going to post images but don't have enough reputation points yet. Images detailing the steps in the GUI can be found at the obfuscated links above.

how to restrict the number of table columns in bapi output

While querying BAPI, we are generally interested in only few columns of a table.
For example PO_ITEMS table (under BAPI_PO_GETITEMS) has 58 columns. While querying, I am interested in only 10 of those columns. But the BAPI response contains all the columns which is a
overhead.
In SQL world, we can always select which columns we want to retrieve. The query response contains only those columns, not all the columns.
I remember I have read somewhere that we can disable unwanted columns coming in response. But when I need it now, I am not able to find information about it.
Can anybody share a code snippet to achieve this? Or specific online resource/pointers would help?
Thanks
Depending on which technology you use to call the BAPI, you can sometimes restrict which parameters are transferred. For example, if you use the SAP Java Connector (JCo 3), you can use the method setActive of a parameter to restrict whether the parameter is transferred. However:
As far as I know, you can only enable or disable entire TABLES parameters or other parameters. You can't enable or disable individual columns.
As far as I know, the BAPI itself does not know about this setting - and even if it would know, few implementations would care.
Sometimes there are additional parameters that allow you selectively enable or disable fields, but that is part of the actual BAPI implementation and not some omnipresent basic technology.
this is not exact answer for your question.i hope it will help.I think we have no option to select certain number of column from a function module tables.but we can access particular row from that table like passing mandatory values from java side .....like this sample code here i did for function module(not table table).
JCoDestination destination = JCoDestinationManager.getDestination(DESTINATION_NAME);
JCoFunction jf=destination.getRepository().getFunction("ZUSER_DET");
jf.getImportParameterList().setValue("FIRST_NAME","username");
jf.execute(destination);
String jfex=jf.getExportParameterList().getString("some column name from return table");
System.out.println(jfex);
it will return a row of table value.you can manipulate whatever you want

Resources