combine two columns and create one in ADF - azure-data-factory

as a step to create my dimensional data model I need to combine two columns and create one new referencing to the units of values from each columns.
I have among other tables one table that has yearly GDP of a country. the table has two columns GDP represented as MONEY (unit) and the other year change (% as unit). in my fact table I would like to have both in same column but with a new columns representing dimension (units). because of that I am wondering how to merge these two columns and create another one that would specify if the value comes from the column with units (%) or (money). this applies to other entities in the data model that can have different units for same variable.
thanks for your help!
Consider orginal data format :
enter image description here
We have quartal dates a series of economic indicator and their values, on the right side there is another table with dimensions of the economic indicator.
What I need is to change data so it should be like this (fact table with quartal date granularity) :
enter image description here

I have reproduced the above scenario with a sample data and able to combine the columns like below.
My sample data of two columns Money and Unit:
Use derived column transformation for the res column which will have the Unit or Money values. To know which column value, I have used another column which_value.
Expression for res column:
iif(isNull(Money),Unit,Money)
Expression for which_value column:
iif(isNull(Money), 'Unit', 'Money')
Result in Data preview:

Related

compute difference between 2 ranked columns in tableau

I am trying to find the difference between 2 columns in tableau. The catch though here is that each column is ranked based on a value. The difference i need is between these 2 ranked columns
The rank is computed using the table calculations rank function. Attaching the picture for more information
I am assuming "current" and "prior" are calculated fields.
Just create a new calculated field, here I'll call it "Result". In this field just minus your one from the other so:
[Current - Prior]
Then pull this new field into your measures values on your sheet.

Table Across Average based on First String Value

Is there a way to calculate the average across a table based on only the value in the first column (School Name) when the first column is a string value? The current values in School Average are not correct due to the additional column values (Grade and Teacher) needed prior to the measures.
This is an ideal use case for LOD calculations. An LOD calculation allows you to specify the dimensions for a calculation as part of the calculation definition -- instead of (solely) by the Tableau shelves and cards.
To start, you can define a calculated field called,say, School_Avg as
{ fixed [School Name] : avg([Grade]) }
Assuming you have a field called Grade.
There is much more to learn about LOD calculations. See the on line help to learn more.

multiply columns of a table in Postgresql

I'm having a table with a column which contains areas of soil types and a column with the productivities of the different soil types (ton/ha). I would like to multiply these columns to have the total productivity (in ton) but I cannot figure out how to do this. Can someone help?

Interactive Report - aggregate sum of multiple columns from one table multiply by values from another Table

I have a challenge in Oracle Apex - I would to sum multiple columns to give 3 extra rows namely points, Score, %score. There are more columns but I'm only choosing a few for now.
Below is an example structure of my data:
Town | Sector | Outside| Inside |Available|Price
Roy-----Formal----0----------0----------1------0
Kobus --Formal----0 ---------0--------- 1------0
Wika ---Formal----0----------0--------- 1------0
Mevo----Formal----1----------1----------1------0
Hoch----Formal----1----------1----------1------1
Points------------2----------2----------5------1
Score------------10---------10---------10------10
%score-----------20---------20---------50------10
Each column has a constant weighting (which serves as a factor and it can change depending on the areas). In this case, the weighting for the areas are in the first row of the sector Formal:
Sector |Outside| Inside |Available|Price
Formal----1----------1 ----------1-----1
Informal--1----------0 ----------2-----1
I tried using the aggregate sum function in apex but it wont work because I need the factor in the other table. This is where my challenge began.
To compute the rows below the report
points = sum per column * weighting factor per column
Score = sum of no of shops visited (in this case its 5) * weighting factor per column
% score = points/Score * 100
The report should display as described above. With the new computed rows below.
I kindly ask anyone to assist me with this challenge as I have tried searching for solutions but haven't come across any.
Thanks a lot for your support in advance!!

Getting the Sum of the Contents of Rows

I have a column with dollar amounts, such as:
$1.00
$4.00
$100.00
and so on. These values are put into the column by calculating the % of another column. I want to get the sum of all the dollar amounts of that column. I cant use Sum(data) because its static data in the column. Is there a way to get the sum easily?
Thanks!
There are a couple of different ways to deal with this:
If it's the same percentage being applied to each row, sum the original column and apply the same percentage to that sum.
If the original source of the data is from a database, do the percent calculation in your Dataset's SQL query, then use the Sum function in your Tablix as usual.
If these don't apply, you'll need to give more detailed information about your problem.