Foundry-Contour: Finding multiple answers for multiple rows of one indicator, multiple times - calculated-columns

I have thousands of 'tickets' which have anywhere from 1-5 scheduled meeting,on different days. I need to check every ticket, pull the final number for those meetings, and produce it for a PowerBI report. For example, Ticket 1 has 2 meetings associated with it, Ticket 2 has 4 meetings associated with it, Ticket 3 has 1 meeting associated with it, and so on.
Currently, I've pulled a meeting count, but the count is weird. For example, I have on ticket with 4 meeting occurrences that is showing as 40, not 4. I am only counting the 4 dates for the ticket, but I'm not sure how to derive the correct number.
I've created an analysis with multiple datasets that I have joined. One of the secondary datasets I've titled Count and pulled in all the data from the DB that lists all the meetings in separate rows. Then created a column that establishes the 'count' over 'partition' by ticket number, ordered by the date/time it was established.
Expression board with the following expression:
count("established") over (partition by "ticket" order by "established")
Then on the primary dataset I've joined that dataset. This is is what is giving me to duplicate rows.I have attempted to use a DENSE_RANK but I'm not sure if that is going to work and how to pull the greatest number meeting (which I tried that and once it hits the highest number of meeting, all other tickets below it have the same number, so that doesn't work).
Expression board with DENSE_RANK:
DENSE_RANK() OVER ( PARTITION BY "ticket" OREDER BY "Count" DESC )
Thoughts on how to accomplish getting something to the effect of:
Ticket 1 = Count of 2 Ticket 2 = Count of 4 Ticket 3 = Count of 1
so that I can pull it over into a visual in Power BI?
Preference is to do this all through contour. If not possible, I will work on a DAX coding in BI.

Related

Efficiency question with excel using index match for each cell in a large sheet

I have a 4 types of customers, each pay in a different payment plan.
group 1 - monthly
group 2 - semi monthly
group 3 - bi weekly
group 4 - weekly
I have a sheet with a range of all the relevant payment dates for those group sorted in the right order in row 1
I would like that for each customer there will be a data validation list (group 1,group 2, group 3,group 4)
When selected the customer's row will populate on the correct dates according to his group number and the date the payment starts.
My work around to do that was to create 4 separate sheets for each group, auto populate from the correct date and run it for all customers in each group meaning you can see for John Doe what and when will be his payments in each group even though he is in group 3 for example. And a MAIN sheet where John Doe has group 3 selected where a MATCH and INDEX is running to find when he is supposed to pay and how much. The issue is that for 400 rows and 300 column this becomes heavy.
How would you go about solving that?
each cell looks like this in the MAIN sheet
=LET(mothlydate,Monthlyrd3!$BK$3:AAC$3,semidate,Monthlyth16!$BK$3:ZZ$3,namemonthly,Monthlyrd3!$BK79:AAC79,namesemi,Monthlyth16!$BK79:ZZ79,
IF(OR($BA96="Monthly 3 rd",$BA96="Semi-Monthly",$BA96="Monthly 16 th"),
IF((IF(IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0)),"")+IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")>$AE96,$AE96,IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0)),"")+IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")))=0,"",(IF(IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0)),"")+IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")>$AE96,$AE96,IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0)),"")+IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")))),
IF($BA96="Bi-Weekly 1",(IFERROR(INDEX(NewBiWeekly!$BK79:AAC79,1,MATCH(GH$2,NewBiWeekly!$BK$3:AAC$3,0)),"")),IF($BA96="Bi-Weekly 2",(IFERROR(INDEX(NewBiWeeklyTwo!$BK79:AAC79,1,MATCH(GH$2,NewBiWeeklyTwo!$BK$3:AAC$3,0)),"")),IF($BA96="Other",(IFERROR(INDEX(NewOther!$BK79:AAC79,1,MATCH(GH$2,NewOther!$BK$3:AAC$3,0)),""))))))
)
THANKS!!!
This is based on a purely textual analysis of your formula, since data required for a meaningful analysis hasn't been forthcoming:
the expression below occurs 4 times in your formula
IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")
as does this one
IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0))
which means that, in the worst-case circumstances, one or both expressions are being evaluated on FOUR separate occasions - it would be sensible to consider making one or both of these named 'values' at the start of the LET() function, such that, in the worst-case cirumstances going forward, each would be evaluated only once.

Counting, filtering, conditioning command in Excel

I am trying to solve this question. The question is:
A sport store target is to provide at least one employee per 10 customers and at least one administer officer per 10 customers. The store checks those figures running a report on the first Friday of the Month every 30 days.
I have added an example of the data. I am trying to identify the months during which the store failed to achieve those figures?
I would appreciate if anybody can help. please see the picture bellow.
=LET(data,FILTER(A:B,(A:A<>"")*(ROW(A:A)>1)),a,INDEX(data,,1),b,INDEX(data,,2),u,UNIQUE(a),x,--(TRANSPOSE(a)=u),mmlt1,CEILING(MMULT(x,--(b="customer")),10)/10,mmlt2,MMULT(x,--(b="SECURITY")),mmlt3,MMULT(x,--(b="administer officer")),FILTER(u,(mmlt3<mmlt1)+(mmlt3<mmlt2),"all correct"))
I took column A for WEEK_ENDING and B for ROLE
You can replace FILTER(A:B,(A:A<>"")*(ROW(A:A)>1)) with your actual data (without headers).
I than took the unique dates and calculated
the count of "customer` matching the date (mmlt1)
the count of SECURITY matching the date (mmlt2)
the count of administer officer matching the date (mmlt3)
I rounded up the customer count to the nearest 10 and then divided by 10.
Now either of the mmlt2 or mmlt3 values should be larger than the count of mmltq (round up & divided by 10) to meet the conditions.
Finally I filtered the unique dates to the conditions. The result spills the dates where either too little security was available per 10 customers, or too little administer officers.

excel PowerPivot Auto Calculated Measures & Columns

After looking at a few similarish questions I figured I needed something more specific so asking here. I will start by explaining the situation:
The Setup
I have a Store which sells Cakes, Cookies and Wine. I have the weekly sales data of each product sorta like this:
Product ID
Product Name
Quantity
Value
Week Ending
1
Ginderbread
2
£4
13/01/22
2
Chocolate chip
5
£25
13/01/22
3
Red Wine Bottle
1
£10
13/01/22
4
Sponge Cake
3
£9
13/01/22
Currently every week's data is stored within the same table, with me using a Week filter to show only the week i'm interested in.
Using this Data I created PivotTables that shows the sales of each category, with the ability to drill down to show the specific products. Table looks something like this:
Category
Quantity
Value
Cakes
2
£4
Cookies
7
£29
Wine
1
£10
The issue
I now want to stick in a new calculated column that shows the Value as a %. E.g The total value for the previous table was £43, so Cookies is about 67%. If I drill down, it would show the Chocolate Chip record as 80% and Gingerbread as 20%
I imagine doing this would be easier if each individual week's data was on a different table, but I got a lot of weeks and I also want to do tables showing the sales for over a period of time. Plus I don't know of a way to merge the "value" and "quantity" columns, etc instead of having 1 for each week being shown.
any advice would be appreciated
Create an extra column in the source table (prior to filtering) entitled "perc" calculated as the corresponding value for each row divdied by the total value across all rows (se pic. / eqn. for first row below) --
=E2/$E$6
No calculated fields required - just include perc as the mesaure of interest in your pivot table, with value setting as 'sum':
The reason why this worked is because of the common denominator - which allows one to sum ratios on a 1:1 basis.
Devising a calculated field using the standard 'fields, items & sets' functionality for ordinary pivot tables would not be feasible / possible as far as I am aware. You would need to move into the realm of power pivots and data models - which is not too complicated (readily accesible directly from the field list per below) - however, I see this as unnecessary complication for the task at hand.
Side notes:
Using table names in your functions is sometimes more convenient when entering, albeit may appear tricky at first when reviewing - first eqn above becomes:
=[#Value]/Table1[[#Totals],[Value]]

Assign specific dates based to an employee level dataset on weighted averages in excel

I have a dataset in excel which shows headcount by employee level and which department each employee would fall under (sales, ops, or support). I would like to send a survey to each employee once every 26 weeks (2 times a year), but I would also like to keep sending surveys every week to ensure continuation of surveys to a certain amount of population split between sales, ops, and support departments based on their weight of the total population.
This way, I am sending surveys every week to a tiny bit of my overall headcount but only repeating people every 26 weeks.
Can anyone please help on how to solve this in excel with a formula?
From attached sample data, how can I split the headcount to send surverys for 26 weeks straight but to different population every week and not repeat? This different population should be split by % of department out of total headcount. Meaning if I have 10 people every week and % split is 40% sales, 30% operations, and 20% support, the survey should be sent to 4 sales, 3 operations, and 2 support people. Please note that the 10 people and the %s may vary every week because of new hires and resignations.
Thank you!
Sample Data
In the data sheet, ceate a helper column D, where you hand out the numbers to each employee, label it MOD. Use the formula for each employee, enter to cell D2:
=MOD(ROWS(A$2:A2)-1;$H$2)+1
That way each employee is assign a number from 1 to whatever is in the cell H2, e.g. 26. Then contact list all employees with 1 and you have the first batch and so you continue each week to get to employees with 26 in 26 weeks. This way all get the survey but just once.
Of course the share of the individual depts cannot be achieved each time, as there are less employees in some. If you wanted to keeps the shares, some employees of the smaller departments would get the survey more times.
If you want to get some randomness into the order, just mix the order of MOD numbers, e.g. start with 7, continue with 23 etc.
I hope I got the question right, I am not sure in some parts.

How to count the amount of times a field appears in a specific 'week' in excel

I have a table:
I've created a new column called Distinct Delivery Week, where I have the weeks 1-52 listed.
I want to create a count function if Week == distinct delivery week, make it so it does a count and returns the Channel category that has the most appearances in each respective week.
For example, if App - Activation Organic appears more often than anything else in Week 1, then it will be returned in a new column next to Distinct Delivery Week
With so many data, it may be helpful if you use a simple PivotTable to count how many times per week does each channel appears, and get TOP 1 per week.
I made a fake dataset kind of like yours:
Then I created a Pivot Table like this:
Fields WEEK and CHANNEL into rows section (first WEEK, second CHANNEL, the order is important)
Again, field CHANNEL into VALUES section (make sure the field does a COUNT operation)
Applied a VALUE FILTER in column CHANNEL --> TOP 10, set it up to show just TOP 1
It's a really easy way to get a list where you can see the channel that appears most per week.
I figured out how to do it using this source.
The formula I used was:
{=INDEX(D1:D74686, MODE(IF(H2:H74686=M2,MATCH(D2:D74686,D2:D74686,0))))}

Resources