Activeadmin - Need to add two values and show it in third column - ruby-on-rails

I am trying to add the values and introduce a new column in Activeadmin, so that when I add the values it automatically sum up the values and show it in the next column.
Image for reference:

Take a title to a column add add the required columns to it.
index do
selectable_column
column "New Column" do |your_model_name|
staff_salary.to_i + visa_&_medical.to_i
end
end
Refer here.

Related

ag-grid columnsMenuTab customization

I am trying to customize the columnsMenuTab display in ag-grid to hide certain group header rows from being shown. We have a column group hierarchy that looks something like:
Name
Type Name
Formula
Column Name
We'd like to hide the Formulas from being displayed inside the columnsMenuTab so that when the user is toggling the column visibility they don't see the formulas but they can still see the column name. The end result would be something like:
Name
Type Name
Column Name
Looking through the documentation (https://www.ag-grid.com/javascript-grid-column-menu/) I was not able to find a way to achieve this customization.
We are using ag-grid-react (enterprise) 21.0.1
Thanks.
05/18 Edit: Added some clarification as to the end result.
You can use suppressColumnsToolPanel: true for the column you dont want to show up in columnsMenuTab as well as the tool panel that shows up on the right.
This works for column or column group in the hierarchy and should work for Formula column in your case.
As per docs-
suppressColumnsToolPanel Set to true if you do not want this column or group to appear in the Columns Tool Panel. Default: false
Still works in #ag-grid-community/core#^28.1.1 #ag-grid-enterprise/column-tool-panel#^28.1.1
I set suppressColumnsToolPanel: true on one of the columns and this column does not appear in the column menu > column selection tab anymore.

Sort Range Ignoring "" Flavor of Blank on Google Sheets

I have a spreadsheet with 2 main columns.
Column A is the student's name.
Column B is the student's grade.
Other columns (not shown) list various information about the student that the end users input.
End users click on the Data Validation Arrow to select the student in Column A, and the student's grade is auto populated in Column B.
The formula in Column B is:
=IF(A2="","",Index(All!$B:$B,Match(A2,All!$A:$A,0)))
The All sheet contains a master directory of the Students and their Grade level assignment.
The Problem:
When users attempt to re-sort the data using the Sort A-Z menu option in B1, it includes the blank cells in the sort - The blank cells come first, moving all the relevant data to the bottom of the sheet.
I understand that G-Sheets considers "" to be text. Is there another method to write my formula that would keep the Grade column blank, but allow for the sorting feature to function as end users would expect?
You can implement two additional comments where you filter the results before sorting them:
=SORT(FILTER(A2:B,not(B2:B="")),2, true)

How to concatenate cells conditionally

I have a google sheet with two columns.
The first column has a number or reoccurring reference like xyz.
The second column has a list of names.
I would like to program a formula to concatenate all names in column 2, that have 'xyz' in column 1.
You can use filter to concatenate Name Column where column Countif are not blank, like this:
=textjoin(",",false,filter(B2:B,A2:A<>""))
or if you next just want to get data Name where column Countif are not blank, do like this:
= filter(B2:B,A2:A<>"")

How do I create a new column based on a rule for 2 columns in Google Spreadsheets?

I have 2 columns on a Google Spreadsheets file. First column is text and the second column is numbers (from 1 to 5, think as categories).
I would like to have a 3rd column from the words in the first row depending on the category. So I would like to have all the words that are "marked" "3" on 2nd column to be listed in column 3.
How can I do this?
Please try:
=query(A:B,"Select A where B=3")

How to leave a blank field in table in sqlplus?

In sql, if some fiels are to be left blank while inserting the values in the table, how shall we do it?
For eg. For name field, i want to insert 'First Name' & 'Last Name' but not 'Middle Name'.
But the field is already present by default in the table.
If I have understood you correctly, you simply need to execute an INSERT sentence, without using the columns (fields) you don't want to inform.
As an example, if you have three columns and don't want to inform column2 use
INSERT INTO table_name (column1,column3)
VALUES (value1,value3);
instead of
INSERT INTO table_name (column1,column2,column3)
VALUES (value1,value2,value3);
Hope it helps!

Resources