I want to get the sum total of one whole field(number type) in another field of the same table - ms-access-2013

For example, in the table below I want to get the total(sum of all the entries) of Sum_Record field in Total_record field of same table i.e 75 Table

Use a form and set this to DataSheetView.
Then you can add the Totals line.

Related

D365/Dataverse - Create Calculated/Look Up Column that is set to the highest date in another table

I have Table 1. It is filled with dates a inspection is going on. Plumbing or Garden inspections for example.
Table 2 links to these appointments and has additional columns with details such as a Person assigned to the inspection, and what property the inspection is at. I need these two tables to be separate as described, and they are linked by a simple ID column.
Is it possible at all to add a column to Table 2 called 'Last Date of Plumbing Inspection'. The idea is for any given Property in Table 2, there can be multiple inspection entries in Table 1 for it. The point of this column is that it should look in Table 1, find the matching ID, find the latest inspection date out of all the Plumbing-related inspections, and then set the column value to that.
The problem I am having with this is it seems like calculated columns can ONLY implement logic using the columns of the table the calculated column was created in. In Table 2, I can't create a calculated column that interacts with Table 1 at all. I could create a look up column, but I can't combine calculated columns with look up columns. Is there a way to build this latest inspection date column without too much complexity?
Actually you can create a Rollup field and put a MAX aggregate function for achieving your requirement from related table. Read more

Instead of selecting a column to sort a table by in a dropdown, how do I add the sorting column names in a separate column?

I have a workbook where I have displayed a table where the user can view the top 3 IDs based on a column they can select from a dropdown (Measure A, Measure B, ... , Measure H):
Now, instead of this, I want to add a separate column called Sorting Criterion to the table that would store the column names with which the respective rows of the table was sorted. So, the expected output is something like this:
How do I do this? I'm open to using Tableau Prep Builder, if needed, for intermediate steps that may be too convoluted for Tableau Desktop.
Create a calculated field that just contains the Sort By parameter. Add this calculated field to your view.

DAX: Use measure outcome to populate calculated column without recalculating measure per row

I have two tables in PowerBI. One called 'Fact_WorstInstance' contains rows of (Index,Instance). For example:
1,2
2,1
3,2
One called 'Fact_AllInstances' contains rows of (Index,Instance,Value). For example:
1,1,'Red'
1,2,'Green'
2,1,'Amber'
2,2,'Red'
2,3,'Brown'
3,1,'Green'
3,2,'Blue'
The first table is essentially a pointer to the worst entry in the second table for the given index (as categorised by some external system).
There is a slicer on which Indexes are visible to the user.
What I want to do is find the worst instance value for the highest visible Index in the 'Fact_WorstInstance' table, and then get all the Index and Value rows from the 'Fact_AllInstances' table for that Instance.
For example, if the slicer isnt filtering then (3,2) should be the active row from from the 'Fact_WorstInstance' table and this should be used to get Instance 2 from the 'Fact_AllInstances' table
1,2,'Green'
2,2,'Red'
3,2,'Blue'
from the 'Fact_AllInstances' table.
I tried to do this in many different ways, by creating a measure on the 'Fact_WorstInstance' which gives the highest visible row. And then use this measure to create a calculated column on the 'Fact_AllInstances', with 1 for worst and 0 for not worst. And then use this calculated column as a filter in PowerBI.
The measure itself gives the expected value. The problem I have is when the measure is used to create the calculated column, I cannot find a way to stop the Index being filtered based on the row of calculated column - and therefore the measure outcome changes for each row.
My measure:
Worst Entry = CALCULATE(FIRSTNONBLANK(Fact_WorstInstance[Instance],1),filter(ALLSELECTED(Fact_WorstInstance),Fact_WorstInstance[Index]=MAX(Fact_WorstInstance[Index])))
My column:
WorstColumn = if(Fact_AllInstances[Instance]=[Worst Entry],1,0)
So instead of getting the output above, I get
1,2,'Green'
2,1,'Amber' --> because for Index 2, the measure gives index 1 as worst
3,2,'Blue'
This is a possible solution you might want to implement.
First of all, calculated columns are not affected by slicers/page filters, you will need to create a measure for that, so the way your are appraching the problem won't work.
Create an additional calculated table that holds unique instances values. In Power BI, Modeling tab there is a icon for creating a New Table, where you can use an expression to produce the table.
Use this expression:
IsntancesCalcTable = VALUES(Fact_WorstInstance[Instance])
Now you have a table called InstancesCalcTable in your model.
Drag the Instance column in the InstancesCalcTable and drop it in the Instance column of the Fact_WorstInstance, this will create a relationship between InstancesCalcTable and Fact_WorstInstance via Instance. A line between both tables will be drawn in the Relationships view, double click that line and you will see the Edit Relationship window.
Make sure it looks like this:
Then do the same for creating the relationship between InstancesCalcTable and Fact_AllInstances.
You will end with a model like this:
Then you can use Index column in the Fact_WorstInstance table, in a slicer and it will filter the Fact_AllInstances table to get only the instances selected.
However if you don't have any filter all rows in Fact_AllInstances will be shown.

Calculated Item in OBIEE - Moving Average

I have consulted this question - OBIEE Moving Average (Mavg) for 4 weeks on Pivot Table - in order to understand how to do a moving average in OBIEE. However, I am having trouble calculating that item in a pivot table.
In the pivot table view I thought I would just select New Calculated Item and create my moving average function for the pivoted values. Yet, in the "Values From" drop down menu the items I want to average are not present. I believe this may be because they are not extracted data values but previously calculated values from the data (in the original table's columns). I tried selecting "treat as attribute column" but this failed as well. How can I created a moving average within the pivot table for a column that was calculated from the original data?
Looks similar to this:
Pivot Table
ID Value
01 45
02 54
03 65
... ...
Where Value is Amount Sold / Days. And both Amount Sold and Days are stored in the original data table.
Go to the criteria tab and pull in a measure (any measure will do). Now edit that measure's column formula to your formula of Amount Sold / Days. I would rename it as well.
When you click over to the results tab, you will see that column added to all views. Just edit each view and remove the column from the views you do not want to see it in. You can also replace your existing value column in your pivot table (if it was present) with this new calculated column.
Pivot table calculated items are typically used in conjunction with columns that are already in the pivot table.

Add row count to a table that dynamically changes if the order of rows change - WEBI 4.0

I have added a table in the webi designer. This is made up of 2 columns, "category" and "measure" and there are 3 rows of data. I wanted to add a column that will hold the row count, so I added a third column titled, row count, and added the formula
=(RowIndex())
This appeared to work as it now populated with 1,2,3 in that order. But if I sort the table by measure ascending, this sort works but my row count is now 2,3,1 in that order. I think this is to do with the formula =(RowIndex()) pulls back the "row count" from the intial sql order and then does not update.
Is there a way to update this so row count is dynamic and recalculates as different sorts are added. So it always stays in order i.e 1,2,3
You are correct that RowIndex() represents the row number from the SQL result set (the "microcube"). You want to use RunningCount() instead.
RunningCount() requires a dimension or measure object as a parameter, as it counts non-null values. But you can pass a static value to count all rows: =RunningCount(1)

Resources