Add columns based on columns which are already added in text table in TABLEAU - report

I need help regarding the text table in tableau. I want to add three new columns based on the columns which are already added in the text table. The three columns at end highlighted in red I want to add.
Please refer to the image
GP Value Diff (which will be difference of G & J)
Sale Value Diff (which will be difference of H& K)
GP % Diff (which will be difference of I & L)
Attaching the excel for explanation and tableau workbook.

Related

Data Comparison in R

I am trying to compare two Excel files (same number of columns, but sometimes different number of rows).
I imported the Excel files to data1 and data2 respectively.
library(dataCompareR)
comparedata <- rCompare(data1, data2)
summary(comparedata)
saveReport(comparedata, reportName = 'Comparison Result')
All goes well, but I have three challenges:
The Sample row data is set to 5. How can I increase that to the actual different row that the summery comes up with?
How can I ask the primary key in the result as it only shows the two matching columns?
Sometimes the numbers of the row don't match, and the data gets off. Can I set up a primary comparison key instead of row to row?

Tables in R: Expand a header title across 4 cells

I have a table in R that has four columns of temperatures. I want the title of all 4 rows to be "Temperature"
I currently have them as 'Temperature.1" "Temperature.2" and so on. This is my first time using R and I believe it will affect a chi-test that I want to run.
Thanks

Change all cells marked X into cell value shown in column P

I need an easy way to convert all X's in a column into the value shown in a cell.
Basically we want to sell multiple products to a client with a target order value split amongst the relevant products - I have done a CountA formula to show how many columns are not blank. Then I did a simple divide to divide the total value over the columns that are not blank (if there are 2 columns marked X then it would be 10,000 / 2 - assuming the target value is 10k) Now I need to change all the X's into the figure shown in the cell as shown in the pic.
I cant for the life of me think of an easy way of doing it but sureley there is?
Screen shot of sheet
You need 2 sets of columns. Your first set has the X's and the blanks to mark which categories are applicable. The second set has the calculated values for the selected categories.
In the value columns, you can use a formula like the following for the first data row and first category:
=IF(E2 = "x", $D2, 0)
Assuming "D" is your "Dvided total" column, and "E" is your "Dairy & S..." column, and "2" is your first data row.

GNUPLOT Plot many series as lines next to each other

I am not sure I can accomplish what I am trying to do with gnuplot.
I am not sure whether it would be better to plot my data as a colored surface plot or in the following way:
Firstly, here is an explanation of my data format.
The first column contains time values. The time typically does something like 0, 1, 2, 3, 4, 5, .... For each time, the row next to the time value contains the data I would like to plot. (This is the y-data on a 2D plot, the x-data is the x index (row index) of the data minus 1 for the first column which contains the time index.
I have many (~ 1000) time values.
So it looks something like this:
Sorry for awful color choice.
Essentially I would like to plot a line graph for each time value, and put these 2d plots side by side in a 3d plot.
Can I even do this with gnuplot?
I hope the question is clear, if not I can try and add more information.
plot 'data.txt' matrix using ($1-1):3:2 every 1::1 with linespoints palette
your Excel data are copied to data.txt
matrix mode plots lines series (it's that you want)
the first and the second parameter in using when plotting matrix are mode specifiers: 1:3 is "plot rows of matrix".
Citing #Cristoph's comment,
"With the matrix option, the column number is available as first
column, the row number as second column and the actual matrix value as
third column."
($1) would be equal to 1 here, but ($1 - 1) means "subtract unity from a column number" - this way x would start from 0 for each row.
every 1::1 - do not include the first column with time values into plot.
at last using ..:..:2 allows you to set different colors (equal to row number) for the palette option.
The answer is based on similar question and answer

Excel overlaping intervals with a type of vlookup

This is a snipet of the data, of which there is a ton, with explanation of what I want to do:
File
Basically I have a number of subsets (marked out by 1, 2 ... in a seperate column) of data which have intervals. I need to know if the intervals in the same two subsets overlap and if yes then I need the value (column C) which is associated with the set in columns E-G to be pasted next to the interval in column J-K that overlaps with the interval in F-G. The problem is that the interval in column F-G overlaps with multiple intervals in columns J-K.
I've been trying to solve this with
=if(or(and(x>=a,x<=b),and(a>=x,a<=y)),"Overlap","Do not overlap")
But the problem is I can't find a way to do this for multiple overlaps. If you think this can't be done in excel and know how else to do it (e.g. R) please let me know.
Thank you
In Excel try this formula in L4 copied down
=IFERROR(INDEX(C$4:C$100,MATCH(1,INDEX((J4<=G$4:G$100)*(K4>=F$4:F$100)*(I4=E$4:E$100),0),0)),"No overlap")
This will find the first row within each subset (if any) where the F/G interval overlaps with the current row J/K interval, if no such row exists you get "no overlap"

Resources