Calculating Count For Difficult Pivot Table With Merged Lines in Sisense - pivot

I want to calculate count of ORDER_DISP_NO for each DISPLAY_SKU like count(ORDER_DISP_NO) group by DISPLAY_SKU. For example it should be 6 for first row and 2 for third row. Please see screenshot
Looks like I cannot use DupCount() in this case but how can I get correct data in the last column?

Related

Assistance needed pivot table, Countif, Averages, and tons of data

I have a pivot table with employees names, their grand totals of cases worked for the month, the days they worked during the month, and the case counts for each day.
I have them all stacked on top of each other on a sheet for fast viewing.
I created a column to countif Column (A) has a partial text value that matches the month.
In that column (AR) it returns 1 for true and 0 for not true.
I'm trying to create a formula where it sums up the 1s between the 0s.
The picture is horrible due to the size limits.
Basically, I need to count the days the employee worked and find the average case count for the month for each employee.
I can't use the average function in the pivot table because the count is based on IDs.
I tried If statements, and SumIfs.
ATTACHED IS A SAMPLE OF THE FILE I'M WORKING WITH
Picture of the Spreadsheet as requested
Sorry, i'm working on Excel in french. But I hope my answer with the file modified will help u understand what I'm talking about.
Here is your Excel sample with my modifications : Your Excel file that I modified
You can create another pivot table, that uses your previous pivot table as new datasource. But before doing that, make sure the elements of your first column "Claimed by" is repeated, by checking the column option "repeat element labels" like this :
In this new crosstab, you add as columns : the sum of "Case Count" ; and the count of "Days".
After that, you can filter the column "Claimed by" by selecting only elements without the word "total".
Then your average will be obtained simply by dividing the two columns.

excel sorting 2 columns by name

i have 2 columns like this
i use function =MATCH(A1;C:C;0) then sort from smallest to largest and result is this
exactly what i want. problem is when i add one value that doesn't exist in one of 2 columns
example (new value marked yellow)
and i got this
i would like to group it firstly by repeated columns then rest. how i can do this? :)

Getting Top Values from One Sheet and inputting onto a different sheet

So I'm going to eventually have 3 sheets. Sheet 1 is where I have data (numbers for a category and a name associated with it. Sheet 2 is where I pull the top 5 users for each category. Sheet 3 is where I have a leaderboard for points gained.
Right now I'm trying to work with Sheet 2 (grab the top 5 performers from each category. I'm fairly new to Excel, but after some research it seemed that XLOOKUP would be the way to go. (i'll attach screenshots below.
I'm using this formula:
=XLOOKUP(LARGE('Cases Test for Categories'!$C$18:$C$55,1),'Cases Test for Categories'!$C$18:$C$55,'Cases Test for Categories'!$A$18:$A$55)
however when using it I get all 0's.
Here's a screenshot of values I'm trying to grab from "Warranty Service Request"
and here is a screenshot when applying my formula
The solution I would want is to grab the 5 largest numbers from sheet 1 with the person name as well.
I don't think that XLOOKUP can get you anywhere near what you want but the formula below will get you one step closer.
=INDEX(List,MATCH(LARGE(INDEX(List, ,2),1),INDEX(List,,2),0),1)
In fact, it's the explanation of that formula which will be of help. Here we go.
List is a named range, perhaps equal to your 'Cases Test for Categories'!$C$18:$C$55. The reason for using a name is obvious. It's shorter. In my test List = A2:B6, in case you want to reconstruct it. Column 1 has names, column 2 numbers.
The term INDEX(List,,2) specifies the second column of List. You can replace the '2' with a formula to specify different columns of the named range.
In fact, INDEX(List,,1) does specify the first column and INDEX(List,4,1) specifies the 4th cell in that column, and that is exactly what you see in my formula. All of MATCH(LARGE(INDEX(List, ,2),1),INDEX(List,,2),0) just serves to find the row number in List, in this example the number 4.
Of course, LARGE(INDEX(List, ,2),1) returns the largest number in column2 of List. The '1' can be replaced by a formula, for example ROW()-1 which would return 1 if placed in row 2 and count up from there as it's copied down. Try =ROW()-1 in any cell in row 2 and copy the formula down.
MATCH([LARGEST],INDEX(List,,2),0) returns the row number where the largest was found, and that is the number we need to return the name from the first column of List.
This will work perfectly for one column and can easily be modified to work for different columns. Your question doesn't specify how you would like to arrange the 5 results from each category but the formula can be modified a little to accommodate whatever you want. What it can not do is to deal with ties. MATCH(LARGE can only find the first of several identical results.
To break ties in this sort of operation is complicated and must be done ether by helper columns in the data table or using VBA. It's definitely the topic of another question. For now I hope that it's a problem you will not have to anticipate.

Individual day data group into week and countif = A

I have a large excel spreadsheet which has a list of "items" in rows and a value per day in columns (which runs for over 500 columns) - for example refer to example:
sample data
What I need to do is count the number of "A" per week - refer to example:
I can manually get the calculation to work (as per the second image) however due the large amount of data I cant get it to automatically drag across. Any suggestions?
I would suggest you to put extra line to your data table (for me under the line with dates), that will for each column tell you week1/week2/...
The formula for this will be
="Week"&WEEKNUM(B2,1), where B2 = 1.1.2017
Than you can use Countifs formula.
The countifs formula will be:
=COUNTIFS(4:4,"A",$3:$3,B$26)
There line B$26 is value "Week1" from your second chart, line $3:$3 is new line we created before and line 4:4 is line for item2 in first chart.
Then just copy down and right and here you go. :-)

advanced filter w/ 1 row above

UPDATE - this was resolved with:
=OR(ISNUMBER(SEARCH("225522",A2)),ISNUMBER(SEARCH("225522",A‌​3)))
As an advanced filter criteria.
The goal was to find 225522 on the second row, and pull the row above it which was accomplished with the above along with the row containing 225522.
Original question
I have several thousand lines on an excel sheet and each second line has a header line labelled USD. I need to filter to find all of the 225522 rows but I need to include the row above it with the USD.
Example:
USD
11111.222222.333
USD
11111.225522.333
USD
11111.222222.333
USD
11111.222222.333
USD
11111.225522.333
I can filter 225522 and usd, but that would just unfilter all of the rows with 222222 leaving me to manually delete thousands of USD rows. It looks like the below...
USD
USD
11111.225522.333
USD
USD
USD
11111.225522.333
But I need it to look like
USD
11111.225522.333
USD
11111.225522.333
Is there a way to filter 225522 and keep the row above it to achieve my example above?
Use an advanced filter with formula criteria like:
=OR(ISNUMBER(SEARCH("225522",A2)),ISNUMBER(SEARCH("225522",A‌​3)))
where A2 is the first row of data in the relevant column and A3 is the second row.
This is may or may not fit your definition of filter.
In an unused portion of your sheet or in a new sheet use the forllowing formula assuming that your data is in the range A3:A2003
=AGGREGATE(15,6,ROW($A$3:$A$2003)/ISNUMBER(SEARCH("22522",$A$3:$A$2003)),ROW(A1))
That will generate a list of row numbers that match your criteria. What you want to do now is have ROW(A1), increase by 1 every two rows it gets copied down. Then you will want to put an if statement in that so that if ROW(A1) is odd, your use the row number -1 to get your USD. and if even that you leave the row number alone. Now tie that in with INDEX and you will generate the list you are looking for.
so to get it to count every second row increasing by 1 we could use something like:
=INT((ROW(A1)+1)/2)
This would turn our formula into:
=AGGREGATE(15,6,ROW($A$3:$A$2003)/ISNUMBER(SEARCH("22522",$A$3:$A$2003)),INT((ROW(A1)+1)/2))
in order to get our -1 to the row number we could incorporate something like:
=-ISODD(ROW(A1))
incorporating that into the previous formula would result in:
=AGGREGATE(15,6,ROW($A$3:$A$2003)/ISNUMBER(SEARCH("22522",$A$3:$A$2003)),INT((ROW(A1)+1)/2))-ISODD(ROW(A1))
The above could also have been achieved with an if statement but I decided to take a short cut.
The last step will be to incorporate it into an INDEX formula. which will wind up looking like:
=INDEX($A:$A,AGGREGATE(15,6,ROW($A$3:$A$2003)/ISNUMBER(SEARCH("22522",$A$3:$A$2003)),INT((ROW(A1)+1)/2))-ISODD(ROW(A1)))
Now you have the formula, you just need to copy it down as far as you need to go. It will start spewing errors when you run out of acceptable rows.
Alternatively you can set it up to display "" when there is an error/it runs out of rows by using the following:
=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($A$3:$A$2003)/ISNUMBER(SEARCH("22522",$A$3:$A$2003)),INT((ROW(A1)+1)/2))-ISODD(ROW(A1))),"")
The draw back to this method is that it performs array like calculations. As such you should limit its use to a defined range and not full column references within the AGGREGATE function. Having said that the Advanced filter option listed in your comments seems much simpler and probably a hell of a lot faster.
UPDATE
Since you need to pull multiple columns, I would adjust your INDEX portion of the formula. Now assuming your criteria column (column where the 225522 is located) is column F I would modify your formula as follows:
=IFERROR(INDEX($F:$F,AGGREGATE(15,6,ROW($F$2:$F$4401)/ISNUMB‌​ER(SEARCH("225222",$‌​F$2:$F$4401)),INT((R‌​OW(A1)+1)/2))-ISODD(‌​ROW(A1))),"")
Now in order to return the same row but different columns there are two ways to approach this. Either change the $F:$F to the appropriate column for each column you want to return or change the range from F:F to F:P and add a column reference to the index. This following method works if the 11 columns are side by side. Other wise you will either have to assign a manual column reference that covers your range or use a match function to match column headers over the same range.
=IFERROR(INDEX($F:$P,AGGREGATE(15,6,ROW($F$2:$F$4401)/ISNUMB‌​ER(SEARCH("225222",$‌​F$2:$F$4401)),INT((R‌​OW(A1)+1)/2))-ISODD(‌​ROW(A1)),COLUMN(A1)),"")
The reason you see me using A1 with ROW() or COLUMN() is that I am using it as a counter that starts at 1. So no real harm leaving it at F1 for row references as it is really only important that the row start at 1. conversely COLUMN(A1) can really be any row from column A as I am only interested in starting at 1. If you have to manually index because your columns are not side by side, replace COLUMN(A1) with an integer that represents the column number you want starting from the first column reference in the index range. So in the case of the formula above F:P, start counting from F.

Resources