plotting multiple lines in Power BI graph - visualization

I would like to plot multiple lines on one graph, but I can't do it with simple "line chart".
I have only one dataset, and what I want to do is to use lines to represent different filters.
I included few filters which are the same for all lines, but each line will have a different filter for one column.
So, to be simple: I am using 4 filters for my dataset, and for all lines 3 filters are the same, but the lines are different because 4th filter is unique for each line (example: Column A = "1" for line A; Column A="2" for line B etc.)
Hope I could explain it well enough,
Looking forward to your answer!

Related

gnuplot scatter plot selecting data on range of value in 3rd Column

In a Windows 7 environment, I need to do a gnuplot scatter plot of 2 columns selecting data based on a range of values in a 3rd column. I know how to do it by creating separate data files for each range, but is it possible to do it by filtering on the data value in a 3rd column without awk
Thanks
plot "<awk '{if($3>=11 && $3<=19) print $0}' plot.dat " using 1:2 with points
warning: Skipping data file with no valid points
I Presume the error is because I don't have awk in windows7 envirenment
There are (should be) many examples of filtering data with gnuplot here on StackOverflow, however, mostly combined with another issue. So, whenever I'm trying to search for a really good and clear example, it takes more time for searching than to simply write down the line.
You definitely don't need awk!
Attention: Filtered data will not be connected in a line plot. So, in case you want to plot connected filtered lines, e.g. with lines or with linespoints you need to prepend an extra line. I assume you have gnuplot>=5.0.
For older gnuplot versions you can check this workaround.
The following will plot column 1 versus column 2, but only if column 3 is in the range 11 to 19.
set datafile missing NaN
plot "myData.dat" u 1:($3>=11 && $3<=19 ? $2: NaN) w linespoints

Tableau layout for multiple charts on one worksheet

I have 15 pie charts on one worksheet (one for each year since 2006). At the minute I can either have them in a vertical line or a horizontal line but I want to have them in 3 rows of 5, how do I go about doing that?
Thanks in advance (from a Tableau newbie) !
What you're looking for could be a tecnqique that consists in creating two additional calculated field for row_indicator and column_indicator.
So assuming you have a pie for each product_category you could create something like this for rows:
if prdocuct_category in ('a','b','c','d','e') then 1
elseif prdocuct_category in ('f','g','h','i','j') then 2
else 3
end
Once you've done the same for columns, you can use those two fields in the worksheet as first field in row/column shelf.
Otherwise, you can check the small multiple technique which is more or less the same and splits your by in groups according to the square root.
Check this tecnique in this video:
https://www.vizwiz.com/2016/03/tableau-tip-tuesday-how-to-create-small.html

Cumulative distinct count across multiple dimensions in QlikSense

I'm trying to count distinct cumulatively with two dimensions.
I have tried the below code which does work when there is only a single dimension, however this does not work with multiple dimensions.
Rangesum(Above(Count( distinct [FieldName]),0,RowNo()))
FYI - attempting this within a line chart
A temporary answer to this is to remove the second dimension and amend the measure.
Rangesum(Above(sum( if(Dimension=1,Measure)),0,RowNo()))
However this does require a separate measure for each possible value in the dimension.

Display multiple values in one line

I'm new to MATLAB. I have two values x and y. Both of them contain values with unknown accuracy. The problem: How could I display them both in one row with 2 digits after comma? Like:
x<tabulation or stack of spaces>y<then goes new line>
Example
RAW data
0,324352 0,75234
1,563 3,4556
Expected output
0,34 0,75
1,56 3,45
Upd: for one value it works well
disp('x=' num2str(x,3));
Purpose is: display TWO values on one row with the new line symbol
The answer is:
disp(num2str([x y],3));
The 3 value means - max.quanity of symbols after comma including it(am I wrong? just thoughts)
Another Idea:
Somehow represent X and Y as array values and then display them.

Preserving matrix columns using Matlab brush/select data tool

I'm working with matrices in Matlab which have five columns and several million rows. I'm interested in picking particular groups of this data. Currently I'm doing this using plot3() and the brush/select data tool.
I plot the first three columns of the matrix as X,Y, Z and highlight the matrix region I'm interested in. I then use the brush/select tool's "Create variable" tool to export that region as a new matrix.
The problem is that when I do that, the remaining two columns of the original, bigger matrix are dropped. I understand why- they weren't plotted and hence the figure tool doesn't know about them. I need all five columns of that subregion though in order to continue the processing pipeline.
I'm adding the appropriate 4th and 5th column values to the exported matrix using a horrible nested if loop approach- if columns 1, 2 and 3 match in both the original and exported matrix, attach columns 4/5 of the original matrix to the exported one. It's bad design and agonizingly slow. I know there has to be a Matlab function/trick for this- can anyone help?
Thanks!
This might help:
1. I start with matrix 1 with columns X,Y,Z,A,B
2. Using the brush/select tool, I create a new (subregion) matrix 2 with columns X,Y,Z
3. I then loop through all members of matrix 2 against all members of matrix 1. If X,Y,Z match for a pair of rows, I append A and B
from that row in matrix 1 to the appropriate row in matrix 2.
4. I become very sad as this takes forever and shows my ignorance of Matlab.
If I understand your situation correctly here is a simple way to do it:
Assuming you have a matrix like so: M = [A B C D E] where each letter is a Nx1 vector.
You select a range, this part is not really clear to me, but suppose you can create the following:
idxA,idxB and idxC, that are 1 if they are in the region and 0 otherwise.
Then you can simply use:
M(idxA&idxB&idxC,:)
and you will get the additional two columns as well.