I have a field (OK) in my cxGrid which is displayed as a checkbox (properties : checkbox). It is an actual database field (boolean) in my SQLite database . Can I group this field so that the grid displays how many items are checked and how many are not (default for groups) ? Right now I managed only to count the items.
The display I have now is something like this :
I need to count checked and unchecked items. Is this possible at all?
EDIT :
In one similar program I have such a feature implemented below) :
Here the sum works since it sums up numbers. In this case I dont know how to sum up
true/false thing... The best next thing I came up in this example is this :
Just changed the field name from 'ok' to' urejeno' ....
Related
I am working on narrowing down the selection from three tables. The hierarchy looks like the link below.
PublisherAccountID includes a list of PublisherName, and within Publisher name, it contains a list of Imprint.
PublisherAccountID > PublisherName > Publisher Imprint
I am creating narrowing options for each hierarchy on Tableau.
For example, if I have two PublisherAccountID, A and B, A contains 1,2,3 while B contains 4,5,6. If I select A, then the option for PublisherName will now show 456.
Sorry I don't know how to not embed pciture link. The heiracy is below
enter image description here
Have you grouped the fields? You can always create a group. You can name the group from the 2nd level i.e. B, and group the relevant items (4,5,6). You can then use the new Group field as a filter.
I'm using SPSS modeler and I have a variable that the software recognizes as numeric. So the missing values are $null$. I want that the missing values of the variable are selectionable with '', as character.
So I would: or trasform the format of the variable from numeric to character or change only the missing values from $null$ to ''.
How can I fix?
thanks in advance
The best way to select null values in a numeric field is to use the #NULL() function from the Blanks and Null section of the Expression Builder.
For example, if you wanted to keep only the null values so that you could inspect them, you might use a Select node. Leave the radio button set as Include. Press the Expression Builder (calculator) button. Change the filter in the drop menu on the left side from General Functions to show Blanks and Null (press B 2 or 3 times). Double-click on #NULL(ITEM). Go to the right side and double-click on your numeric field name. Put a Table node at the end and run it.
Using Select #NULL in IBM SPSS Modeler
Another way to view just the null rows is to enter the #NULL(varname) function into the "Highlight records where" section of the Table dialog box.
"Highlight records where" dialog
When you run the table, any row that is true for this condition will be shown in red.
If you really need the variable to be a string, then use a Compute node to create a copy of this field under a new name and use the to_string() function in the Conversion section of the Expression Builder to change the type of the variable. Now you will be able to use the the Select node to grab "" as the missing value. Or you could use the Filler node to replace the column, but then you would not be able to compare before and after.
The dialog examples shown in this answer use this sample stream that is installed with your IBM SPSS Modeler software:
C:\Program Files\IBM\SPSS\Modeler\18.0\Demos\streams\featureselection.str
The easiest way to do it it's using the Fill node with the configurations:
A) FIELD
B) Condition = #NULL(#FIELD)
C) Replace by = ' '
This node will replace all $null$ for ' ' at the same variable chosen in option a.
I don't think you can customize how you visualize $nulls. (I know it's possible in SQL db though)
So I'd suggest that you work with the numbers and when you want to visualize or export the results, then turn the field to a string one then replace nulls:
Filled node > to_string(#FIELD)
Filler node > blank and nulls > #FIELD = ''
I have a DevExpress TcxDBLookupComboBox v12.1.5 with:
DataBinding.Datafile -> integer field
DataBinding.DataSource -> dbisam table
DropDownListStyle -> lsEditList
ImmediatePost -> true
ListFieldIndex -> 1
ListFieldNames -> itemcode; itemname
Item Code is a integer field, that I want to be retrieved to the connected dataset. However I want to search on the drop down list by the item's name
That is working, due the ListFieldINdex, however when I select the item on the drop down list it retrieve the itemcode and display the itemname on the edit box. That is not what I need.
I know I can change the DisplayValue using the OnValidate Event of the component, however I cant find how to retrieve the selected itemcode from the dropdownlist. Using the connected dataset field always return 0. ImmediatePost is not changing anything on the field. I am retrieving fields from the dataset using the FieldByName property.
How can i get the itemcode seleted to pass to the DisplayValue on the OnValidate?
Is there a better way to do this?
UPDATE:
I am now using the SyncMode, and by that I can easily get the itemcode from the record selected.
However I could not make the control work the way I need:
to enter the itemcode directly for direct access
to open the lookup for itemname search
display the ItemCode when the I find the search by itemname and the lookup list get closed
I have a table with many fields and additionally several boolean fields (ex: BField1, BField2, BField3 etc.).
I need to make a Select Query, which will select all fields except for boolean ones, and a new virtual field (ex: FirstTrueBool) whose value will equal to the name of the first TRUE Boolean Field.
For ex: Say I have BField1 = False, BField2 = True, BField3 = true, BField4=false, in that case SQL Query should set [FirstTrueBool] to "BField2". Is that possible?
Thank you in advance.
P.S. I use Microsoft Access (MDB) Database and Jet Engine.
If you want to keep the current architecture (mixed 'x' non-null status and 'y' non-status fields) you have (AFAIS now) only the option to use IIF:
Select MyNonStatusField1, /* other non-status fields here */
IIF([BField1], "BField1",
IIF([BField2], "BField2",
...
IIF([BFieldLast], "BFieldLast", "#No Flag#")
))))) -- put as many parenthesis as it needs to close the imbricated IIFs
From
MyTable
Of course you can add any Where clause you like.
EDIT:
Alternatively you can use the following trick:
Set the fields to null when the flag is false and put the order number (iow, "1" for BField1, "2" for BField2 etc.) when the flag is true. Be sure that the status fields are strings (ie. Varchar(2) or, better, Char(2) in SQL terminology)
Then you can use the COALESCE function in order to return the first non-value from the status fields which will be the index number as string. Then you can add in front of this string any text you like (for example "BField"). Then you will end with something like:
Select "BField" || Coalesce(BField1, BField2, BField3, BField4) /*etc. (add as many fields you like) */
From MyTable
Much clearer IMHO.
HTH
You would be better using a single 'int' column as a bitset (provided you have up to 32 columns) to represent the columns.
e.g. see SQL Server: Updating Integer Status Columns (it's sql server, but the same technique applies equally well to MS Access)
The LHS is still dynamically populated with a query, but if it doesn't have a value that you want, then you can just type in a value in the textbox and then add that to the RHS of the shuttle (and update the corresponding tables in the database when you submit). It should also be okay to add that to the LHS when you click on the '<' or '<<' button.
I think that is doable. To add the value in the text box to the r.h.s. of the shuttle just do this:
:p1_shuttle := :p1_shuttle || ':' || :p1_textitem;
(You may need to set the shuttle item's LOV "Display Extra Values" property to "Yes" to be able to see the value.)
You are then able to shuttle the new value to the l.h.s. However, it won't appear on the l.h.s. after a page refresh unless in the meanwhile your code has added the new value to the table the LOV is based on.