how to fill cells by column first? - matlab

How would you fill columns first with a defined variable, then move down and fill by column first?
For instance, I have an array filled with 24 names (24x1) and I want to split the names into 4 groups (columns). I want 4 names in each column till the 24th name.

There are two ways to do it
1.Transpose your matrix at the end:
example=example.'
or
example=transpose(example)
2.You can directly fill in column:
I write an example down there. The important part is a(it,1)=it
it=1;
while it~=25
a(it,1)= it;
it=it+1;
end

Related

Function to call the Name of a column in TABLEAU

I have a problem with Tableau.
I have a Dataset with some rows and some columns. I want to write a IFELSE structure where
The IF condition is that the Value of special field(fixed by a row and a column) is equal to the header of a column (it is every time equal to one name(header) of the different columns).
So to summarize: one value is every time equal to the name of a column and to find the column shall be the if-structure
Does someone know if there is a function to call the name (header) of a column? I didn't find it
Here is an small example, in which the Calculated_function choose the right price according to the Barcode. Everything in the first raw, is the header_name of the column below. enter image description here
Best regards
Jonas
You can work like this.
I created a sample dataset as given by you
Step-1: Connected With data in tableau. Clicked all columns having price (4 here), pivoted them so that they look like this..
Step_2: Create calculated_field like this
if [Barcode] = [Barcode_c]
then [Price] END
Step3: Filtered out null values from calculatedField and got a view like this which can be tweaked as per liking.

How can I rename several columns in dataprep?

I have more than 100 columns in dataprep whose names are like:
my column name 1
my column name 2
I would like to rename the name of the columns to be:
my_column_name_1
my_column_name_2
I have tried to do a rename, changing " " by "_". However, dataprep only changes the first whitespace! Is there any way to change all the whitespaces?
Another question, when I do a function like rename, it is done just for a column. I can add more columns writing the name of de column. Is there any way to select all columns without writing all the names?
thank you so much!
You can shift-select multiple columns to Transform when the data is in column view mode.
Select the columns to apply to and then choose the transformation.
JSDBroughton answer did the trick for me although it's not so clear how to do it. Change your view to Columns (second icon from the left on the toolbar). Select the first column, then hold Shift and select the last column. You should now have all columns selected. Then right clock and select Rename. A new Recipe step will be added with all your columns already added. Then set the Option to "Find and replace".
In terms removing all the spaces I couldn't find any Cloud Dataprep pattern or Regular Expression which let me replace all my spaces in my columns. Having said that my columns had a maximum of 4 spaces so I simply added the same step multiple times. I used the Regular Expression \s to match spaces and I replaced them underscores.

Breakout concatenated field into rows not columns within Tableau

I have two fields that contain concatenated strings. The first field contains medical codes and the second field contains the descriptions of those codes. I don't want to break these into multiple fields because some of them would contain hundreds of splits. Is there any way to break them into a row each like below? The code and description values are separated by a semicolon (;)
code description
----- ------------
80400 description1
80402 description2
A sample of the data:
One way is you can custom split two columns at ; which will create separate columns for every entry then you can pivot code columns and description columns separately.
One issue will be you can't guarantee if every code is mapped to correct description.
One more way is export data to excel sheet and then split and pivot the columns and then match the code and description, Then take the excel as datasource to the tableau.

Issue when creating category charts in Tableau?

I have a table with different columns called "Bajo conocimiento...", "Exceso de...", etc. Each column has discrete values: 1, 2, 3 or empty (NULL). I need to count the number of occurrences of 1, 2 and 3 in each of these variables.
What I did first was to create bins for each variable. Thus I was able to create a graphic shown below.
However, the problem is that always one of variables is automatically picked as a filter. In the example below this is "Bajo conocimiento..." (the blue one). So, the values for "Bajo conocimiento..." are correct, however, for instance, the COUNT("Exceso de...") for the values 1, 2 and 3 are the intersections of "Exceso de..." with "Bajo conocimiento...". As a result, the values of "Exceso de..." are lower that they should be.
How can I count the occurrences of 1, 2 and 3 for each variable independently and get the resulting chart?.
You will have to create a table calculation for every one of your columns.
Create a calculated field with the following formula and call it eg [ExcesoCOUNT]:
{fixed [columnname]: COUNT([columnname])}
if you drag the newly created field on your dashboard and turn it into a AVG() rather than a SUM(), you will get the count of each value.

Excel 2013 - Sumifs - Add all cells in a column

I have the following formula in my Excel 2013 spreadsheet:
=SUMIFS(Employees!$T$2:$T$1114, Employees!$L$2:$L$1114, $A5, Employees!$J$2:$J$1114, 1, Employees!$Q$2:$Q$1114, "N", Employees!$K$2:$K$1114, C$3)
It is summing column T based on certain criteria. Looking at Employees!$T$2:$T$1114 as an example, I have a header row, so I start at T2. I then select all the cells in that column. which currently ends at 1114. The problem is, that number can change.
If I want to remove the hard-coding and just select all the cells that contain data in that column, then sum that data based on this criteria, how would I change this?
If the header above T isn't sumable, and/or the header above L isn't a valid criteria, then it won't matter if they are included in the sum_range and criteria_range, respectively. In that case, you can specify entire columns, like Employees!$T:$T, and not worry about where the data starts or ends.
=SUMIFS($A:$A, $B:$B, G2)
If there is data above the desired part of T, you could add another criteria to avoid it, for instance, by using an additional (hidden) column with markers.