Questions tagged [calculated-columns]

A calculated column is calculated from an expression that can use other columns in the same table

A calculated column is calculated from an expression that can use other columns in the same table. The expression can be a noncomputed column name, constant, function, and any combination of these connected by one or more operators. The expression cannot be a subquery.

2235 questions
0
votes
1 answer

Django DRF calculated fields check

I want to check if the computational values ​​coming from the frontend to the price table are correct. E.g; The discount added to this by giving the Sales Price, the early booking discount is reduced to CostPrice. The difference between CostPRice…
0
votes
1 answer

Rounding error across all column values in Python

Good afternoon, I have a useful piece of code copied in below that appears to work on my dummy data, alas it doesn't work across all values as it goes down the column data. Code is: import pandas as pd from decimal import * Data['Value'] =…
0
votes
2 answers

Pandas - iloc - comparing value to the cell below

For the following table: Using Pandas - I would like achieve the desired_output column, that is TRUE when the value below the current cell i different - otherwise FALSE. I have tried the following code - but error…
0
votes
3 answers

How do I write r code that loops for a time series?

I have a dataset of two columns, the year and temperature. Year Temperature 1869 51.4 1870 53.6 1871 51.1 1872 51.0 1873 51.0 1874 51.3 1875 49.4 1876 51.9 1877 52.8 1878 53.6 1879 52.3 1880 …
Christiana
  • 23
  • 3
0
votes
1 answer

Add total to and pivot a dataframe that has both numeric and text data

I have what I thought was an easy question but turns out to be quite tricky.... I am trying to pivot a df from wide to long, adding column totals before pivoting. The df contains text and data however and this seems to make it problematic? Also,…
0
votes
1 answer

Calculated Column Duplicate Values

I am fairly new to access. I am trying to create a column that calculates duplicates values in a query. Taking in consideration that the duplicates value may change after other few filters taking action. Supplier Spec SupplierDuplicate A …
0
votes
1 answer

How can I get Excel to generate columns dynamically, according to the values in a different column?

In Excel 2016, I have a "Brands" column, each of its rows containing a string. The set of possible string values is limited, and they may appear more than once. There is related data in another column, "Models". Each model value is always…
jarmanso7
  • 117
  • 1
  • 1
  • 8
0
votes
1 answer

Define new variable to take on 1 if next row of another variable fulfills condition

so I´m trying to set up my dataset for event-history analysis and for this I need to define a new column. My dataset is of the following form: ID Var1 1 10 1 20 1 30 1 10 2 4 2 5 2 10 2 5 3 1 3 15 3 20 3 9 4…
0
votes
1 answer

How to creating a new column in python using data from two separate columns of a pandas DataFrame?

Need help in writing this SQL update statement in python using the pandas library. UPDATE example_table SET NEW_COLUMN = EXISITNG_COLUMN *2 WHERE SOME_OTHER_EXISTING_COLUMN IN ('Value1','Value2','Value3','Value4') Just to clarify, I want to create…
0
votes
0 answers

Combine rows with same position from many different data frames and add column with a calculation result

Let's say I have 36 different data frames, which are all identical (in columns, row length), except for the content. I am trying to extract two specific rows (401 and 446) of two different columns from each data frame and merge these into a new data…
fredo
  • 1
0
votes
1 answer

SQL: get variance for multiple columns without using PIVOT

I have a datatable (dt) like the following in SQL: ID state_id act rd_1 rd_2 rd_3 rd_4 rd_5 11 abc,13.3 1 1. 31 17.4 32.4 0.4 11 afd,23.2 4 1. 42.1 1.3 31.9 0.39 11 dfw,154 …
lll
  • 1,049
  • 2
  • 13
  • 39
0
votes
1 answer

So i am not able to create a calculated column for a table in mySQL, it says calculated columns cannot be calculated from calculated columns

I am trying to create a calculated column but it shows error for the total_value column as it cannot be created from an calculated column vat_value... Is there a way around it, I desperately need those two columns in the table. Thanks, create table…
SagarRawat
  • 135
  • 2
  • 10
0
votes
0 answers

Angular Table - Columns are not totaling/summing up for a calculated column. Totals works fine only when value in inputted in the input textbox

html code
Santhosh
  • 1
  • 3
0
votes
1 answer

Spotfire: Calculated Column to find if a different event in same column occurs within 1 hour

The calculated column I am trying to create is the far right column in the below table: In words: If a B event occurs in the specified City, does a C event occur within one hour of the B event, true or false. I've tried a few different approaches…
jmeddy
  • 109
  • 1
  • 5
  • 16
0
votes
1 answer

Datatype conversion and calculated column

I have a table with the following structure: Unfortunately, the sale_date is stored as INT and I had to find a way to convert it in quarter (202001 will be Q1). The conversion worked well, but I need to include also some calculated columns based on…
Items Value % of value Rate Calculated Value