In excel macro, i am trying to get numbers to group as follows.
1
1
2
2
5
5
5
1
1
7
7
7
7
1
1
My data is in the format above. I need the numbers that are next too each other need to group.
For example
1 Grouped
2 Grouped
5 Grouped
1 Grouped
7 Grouped
1 Grouped
Can anyone help?
Grouping data in Excel has many straightforward options
Grouping in excel is available:
based on the "outline" feature
based on the "grouping" feature
based on the "pivot table" feature
See also
MSFT Excel Support -- Pivot tables
Related
I am building my dashboard using AWS QuickSight. This dashboard contains 8 filters and I need to apply a Dynamic filter using the date as parameter on only a subset of visuals (only 4 of them). For the remaining visuals (means the 4 remaining visuals), I am going to use another date as a filter.
Briefly, the two filters are date 1 and date 2 where the date 1 filters only 4 visuals and the date 2 filters the remaining visuals.
Is there any way to make it automatically? because the unique solution was using the custom action assign one filter to table 1 for example and then associate the table 1 with the remaining visuals (table 2, figure 1 and figure 2).
Another problem was that after selecting the date 1, I need to click on table 1 so the filter is going to be applied to table 2, figure 1 and figure 2. I want to avoid this and after selecting the date 1 is going to be automatically applied to table 1 , table 2 and figure 1 and figure 2
In Quicksight filters, there is an option to apply the filter for selected visuals and tables (you can choose which visuals or tables you want to apply filters). You can put multiple filters for multiple tables/visuals and add it to the sheet so that you can change from the sheet
Quicksight filter options
As you can see, running totals appear fine. e.g.
For created tickets, values are as follows:
Created Date
Count
Running Total
01/11/2021
2
2
02/11/2021
3
5
03/11/2021
4
9
04/11/2021
3
12
05/11/2021
3
15
You can also see that the graph should be using the measure to generate the lines but for some reason it's not showing the running total; just the daily count.
Any idea what I'm doing wrong here?
Resolved this by appending the two datasets into one table. I thought I could have the two datasets connected by a date table to produce my required result but as pointed out by sydadder, this is no good.
Final result
I have the following output from two tables.
Item# Desc Sales Rank1 Company Sales Rank2 Rank Diff
1 Wigit1 500 1 ABC 15 32 31
2 Wigit2 300 2 XYZ 80 16 14
Rank1 data is from table A and Rank2 data is from table B. Both tables are tied together with the Item#. I'm trying to correctly get the Rank Diff to calculate from Rank2 - Rank1.
Do this in Power Query with a simple merge and add a Custom Column with the arithmetic. This can all be achieved using the menu and options, no code required. This is the same as in Excel, so here's a walkthrough from Microsoft that goes through all the steps you might need. Once you start using Power Query you won't look back. Good Luck!
if you don't have excess to 'Transform Data'( Power Query new name), then simply go to modelling tab and create a new column
Rank_Diff= TableName[Rank2]-TableName[Rank1]
Say I have the table
[3 0 2 5 8 1
2 9 8 3 1 2
9 8 3 2 3 1]
All I want is a function to yield the column
[19
25
26]
without having to type out literally every single column name. My actual data matrix is 30 columns long.
Is there a way to do this that I'm missing? Or is DAX just completely incapable of doing this? I've Googled every single possible combination of the words "sum", "row", "-column", "PowerBI", and "DAX" and gotten absolutely nothing useful. Why in the world would SUM and SUMX automatically assume that the user would always in every single instance ONLY want to sum along dimension 1?
This is not easily done in DAX, as far as I know. Your only options are to spell out all the columns, or drop that requirement and follow the instructions in my earlier answer on how to do this with the Query Editor (i.e. PowerQuery).
Your "why" questions are possibly just uttering of (quite understandable) frustration, but trying to answer them nonetheless: I think the basic idea of tabular reporting is that you aggregate over rows, not columns, and all nearly operations are centered around those. In PowerBI (and many other reporting tools) you need to (un)pivot your data first to do the type of query you're after, which comes full circle to abovelinked solution.
I'm currently producing some work on a win percentage rolling average for international football managers, as I aim to use this in some duration modelling in the future. I'm just a little unsure on how to produce this rolling average in Stata to take account of the dummies for win, draw or loss and when the manager leaves their job. I've also produced a 'result variable' merely as a category variable capturing these three outcomes.
E.g for the first 3 observations in my dataset I have the first manager who wins his first two games and loses his third; after this he then leaves his position. So numerically he would have 100% win percentage for the first and second observations followed by 66.6% for the third. Then the win percentage would have to reset for the new manager. I've coded managers' ids respectively if this helps. I'm just wondering how to code this rolling average properly as opposed to using a calculator each time?
Suppose you have data like this with a win or lose dummy:
win manager_id game_num
1 1 1
1 1 2
0 1 3
1 2 1
1 2 2
1 2 3
0 3 1
0 3 2
1 3 3
You can use something like this:
bysort manager_id (game_num): gen pct = sum(win)
replace pct = 100*pct/game_num