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
2 answers

finding the row with earliest date for each customerID who purchased specific product and return the date in new column

I'm working with PowerBI and have the following table: customer_id|item_id| date 1 | A | 01/01/01 1 | B | 01/01/01 1 | A | 02/02/02 1 | A | 03/03/03 2 |…
Anne D.
  • 3
  • 1
  • 2
0
votes
2 answers

In MySQL, can we use the COUNT and SUM value to calculate a value in another output column using a single SELECT?

Lets say we have something like: SELECT COUNT(IF(Column1 = 1, NULL, 1)) AS "A", SUM(Column2) AS "B" FROM MyDatabase; On the same query, can we add a column that would be A * B for example with one single SELECT overall?
CelestialEX
  • 106
  • 10
0
votes
1 answer

Spotfire - Filtering a Table by Values in a Calculated Column

I am trying to filter a table visualization of all of my data by looking to see if a Study Number contains Activity A. If a Study Number contains Activity A then I want to filter for all rows containing those Study Numbers even if the Activity is…
0
votes
2 answers

Remove weekends in a formula

I want to remove weekends from a calculated column calculation. I am having a formula which calculate daily target: Daily MAL Target = [MAL_Qtarget_A] / (ENDOFQUARTER(Marketing_targets_MALMEL[Date]) - …
Mishi
  • 55
  • 1
  • 2
  • 12
0
votes
1 answer

Hide a field in SharePoint based on Conditions from another field

I have a SharePoint list that I'm using to track employee sick time. The "Actual Arrival/Departure Time" field is meant to display the actual time that the employee arrived/departed if they weren't out for the entire day. What I'm trying to do is…
0
votes
1 answer

TSQL Query column which is true if condition is met within "chain" of rows

This is a follow-up from this question. This is going to get complicated. I have a table like the following for tracking the start and end of incidents of a specific type: +----------+-------------+------------------+------------------+ | PersonID |…
0
votes
0 answers

Is there any hard cut rule that all the tables in the data model should have a join condition to fact table

I'm working on building a data model/calculated view on SAP HANA DB. And I was in need of a dummy table which is not linked to the fact table. When I run the model, it started throwing an error that there is an issue with the logical table join. I…
Arvind
  • 192
  • 1
  • 10
0
votes
1 answer

SAP HANA calculated column - get last month data

I had created a calculated column to get last month data by subtracting '1' from month using the following code: string(int(rightstr(leftstr(string(now()),7),2))-1) But it doesn't work when it's january (january = 1, so 1-1 = 0). I have already…
0
votes
1 answer

Performing an operation on the result of a query, without saving a table

I'm very new to SQL and T-SQL, so please forgive any mistakes in terminology or if the answer is obvious - I don't even know where to start googling for the solution to this problem. I only have SELECT permission on a T-SQL server. I have a query…
0
votes
1 answer

SharePoint Excel Calculated formula for Column

I have calculated field in my SharePoint 2016 on premises list, which checks for four 4 columns and update the calculated column based on the result, I have used this formula but its showing syntax error. =IF(Column 4=ISBLANK,IF(Column…
MHI
  • 37
  • 4
0
votes
1 answer

Powerbi Calculated Column Parameter value passing with no table relationship

I have a scenario where I need to pass a parameter value in the calculated column measure, and there should not be any relationship between the parameter table and the master table. Below are the sample calculated column I have created. Title = var…
Prem Chand
  • 126
  • 1
  • 10
0
votes
0 answers

I want to calculate values based on the same Dateframe.. the new values have to be appended to the Dateframe . How to do that?

This is my code: df = pd.read_csv(r'C:\Neuer Ordner\Strompreis.csv', sep=';', encoding = 'unicode_escape', index_col=0, parse_dates=True ) dd = list() for i in range (0,5): x =…
0
votes
2 answers

getting rid of NULL rows when transforming a row into a column

I've got the following SQL code: SELECT TOP (1000) a.[JourneyNumber] ,a.[JourneyDate] ,a.[tReg_ID] ,a.[Reg] ,a.[ID] ,b.tLocationPosition_ID ,c.LifeCode ,c.LifeTotal ,CASE WHEN c.LifeCode LIKE 'LCF1' AND b.tLocationPosition_ID =…
0
votes
1 answer

how to group the column and get the value based on smallest date in PowerBi

I am trying to make a new column which will give the result from a column based on smallest date from another column. I can find minimum date using (calculate(min(Date),allexcept(table[Id])) ID Date Value Result 192 23/4/2019 A1 …
kulvir
  • 59
  • 2
  • 3
  • 11
0
votes
2 answers

Calculated column value based on rows above SQL

I have this stupid table in our program db. Program is not ours so there is no way to change table contents. The table stores SQL like expressions in unreadable codes. I am translating those values back to SQL expressions to run these expressions.…
Sunfile
  • 101
  • 1
  • 4
  • 22