how to count of issue with open status in spotfire - spotfire

I need to calculate count of issue ID for each month with open status.
I have below 3 columns-
Issue_ID
Issue_Open_Date
Issue_Closed_Date
Issue_ID Issue_Open_Date Issue_Closed_Date Open_Issue_Count(required output)
IS_10 11/11/2014 1/5/2015 3
IS_11 11/12/2014 12/14/2014
IS_12 11/13/2014 11/15/2014
IS_13 11/14/2014 3/5/2015
IS_1 12/1/2014 12/15/2014 4
IS_2 12/2/2014 2/10/2015
IS_3 12/3/2014 1/15/2015
IS_4 1/1/2015 2/10/2015 4
IS_5 1/2/2015 3/11/2015
IS_6 1/3/2015 1/22/2015
IS_7 2/1/2015 3/5/2015 3
IS_8 2/2/2015 2/2/2015
IS_9 2/7/2015 2/28/2015
IS_14 3/1/2015 4/5/2015 1
Based on above table, i need a count of open status of each month.
lets suppose in December i need to count than it should check in dec and nov month.
If any issue is closing in same month, it mean that is not in open stage,
Basically for each month it should check for their records also and previous month records also.
Required output is below-
Nov- 3
Dec- 4
Jan-4
Feb-3
march-1

So... I have a way but it's ugly. I'm sure there's a better way but I spent a while banging my head on this trying to make it work just within Spotfire without resorting to a python script looping through rows and making comparisons.
With nested aggregated case statements in a Cross Table I made it work. It's a pain in the butt because it's pretty manual (have to add each month) but it will look for things that have a close date after the month given and an open date that month or earlier.
<
Sum(Case
when ([Issue_Closed_Date]>Date(2014,11,30)) AND ([Issue_Open_Date]<Date(2014,12,1)) then 1 else 0 end) as [NOV14_OPEN] NEST
Sum(Case
when ([Issue_Closed_Date]>Date(2014,12,31)) AND ([Issue_Open_Date]<Date(2015,1,1)) then 1 else 0 end) as [DEC14_OPEN] NEST
Sum(Case
when ([Issue_Closed_Date]>Date(2015,1,31)) AND ([Issue_Open_Date]<Date(2015,2,1)) then 1 else 0 end) as [JAN15_OPEN] NEST
Sum(Case
when ([Issue_Closed_Date]>Date(2015,2,28)) AND ([Issue_Open_Date]<Date(2015,3,1)) then 1 else 0 end) as [FEB15_OPEN] NEST
Sum(Case
when ([Issue_Closed_Date]>Date(2015,3,31)) AND ([Issue_Open_Date]<Date(2015,4,1)) then 1 else 0 end) as [MAR15_OPEN]>
Screenshot:
As far as doing it with python you could probably loop through the data and do the comparisons and save it as a data table. If I'm feeling ambitious this weekend I might give it a try out of personal curiosity. I'll post here if so.

I think what makes this difficult is that it's not very logical to add a column showing number of issues open at a point in time because the data doesn't show time; it's "one row per unique issue."
I don't know what your end result should be, but you might be better off unpivoting the table.
unpivot the above data with the following settings:
pass through: [Issue_ID]
transform: [Issue_Open_Date], [Issue_Closed_Date]
optionally rename Category as "Action" and Value as "Action Date"
now that each row represents one action, create a calculated column assigning a numeric value to the action with the following formula.
CASE [Action]
WHEN "Issue_Open_Date" THEN 1
WHEN "Issue_Closed_Date" THEN -1
END
create a bar chart with [Action Date] along the X axis (I wouldn't drill further than month or week) and the following on the Y axis:
Sum([Action Numeric]) over (AllPrevious([Axis.X]))
you'll wind up with something like this:
you can then do all sorts of fancy things with this data, such as show a line chart with the rate at which cases open and close (you can even plot this on a combination chart with the pictured example).

Related

Use a Count field as a row in Excel Pivot table

Not sure if it is possible but I'd like to have a pivot table that summarizes how many occasions properties have been missed, and then shows the number of times properties have been missed that many times.
What I'm looking to end up with is something like the below:
TIMES MISSED PROPERTIES MISSED THAT AMOUNT OF TIMES
1 102
2 76
3 23
4 11
5 2
Information is currently in the following format:
UPRN DATE MISSED
1029292 1/1/2020
1029292 5/6/2020
1010101 1/2/2020
1046353 4/3/2020
3894387 8/2/2020
3894387 7/2/2020
3894387 9/2/2020
So this would give the following table:
TIMES MISSED PROPERTIES MISSED THAT AMOUNT OF TIMES
1 2
2 1
3 1
Is this possible? And if so, how?
Pivot tables in Excel can summarize data not only with SUM function, but also with COUNT and other functions.
Right-click a field in the "Sum values" field chooser and then select Value Field Settings... From there you can choose the function to summarize your data (COUNT in your case).

Grab minimum time in year

As an athlete I want to keep track of my progression in Excel.
I need a formula that looks for the fastest time ran in a given season. (The lowest value in E for a given year. For 2017, for example, this is 13.32, for 2018 12 and so on.
Can you help me further?
Instead of formula you can use PIVOT
Keep the Year in Report Filter and Time into Value. Then on value field setting select min as summarize value by.
So every you change the year in the Filter the min value will show up.
=AGGREGATE(15,6,E3:E6/(B3:B6=2017),1)
15 tell aggregate to sort the results in ascending order
6 tells aggregate to ignore any errors such as when you divide by 0
E3:E6 is your time range
B3:B6 is you Year as an integer.
B3:B6=2017 when true will be 1 and false will be 0 (provide it goes through a math operation like divide.
1 tells aggregate to return the 1st value in the sorted list of results

How to create a ranged frequency table using Excel Cube functions

What I want is to create something like this (see image) in Excel that pulls in the frequency of my chosen category from a table within my PowerPivot data model. The output would also need to be dynamically filtered via a cell reference.
Using the below data set as an example:
Week 1 A
Week 1 A
Week 1 A
Week 1 A
Week 1 A
Week 1 B
Week 1 B
Week 1 C
Week 1 D
Week 2 A
Week 2 A
Week 2 A
Week 2 A
Week 2 A
Week 2 A
If I filtered to Week 1 through my set expression, the following output would be produced
1 2
2-4 1
5+ 1
However, if filtered to Week 2, this output would be produced
1 0
2-4 0
5+ 1
I say 'set expression' because I am assuming the way to do this is through the CUBESET function possibly with a MDX FILTER function and the CUBESETCOUNT functions though I am open to other suggestions. Even though the example doesn't show it, I need the expression to filter multiple dimensions from my cube, in particular, date, which is found in my calendar table.
I also understand that I could create specific measures within PowerPivot to handle this (sample formula below), but I would like to know if this is possible via the CUBESET function.
Freq (5+):=CALCULATE(
DISTINCTCOUNT([myColumn]),
FILTER(myTable,
COUNTROWS(FILTER('myTable', [myColumn] = EARLIER([myColumn]))) >=5 )
)
I am also open to creating a helper column within my Powerpivot table.
Thanks,

Excel 2010 Dax Onhand Quantity Vs. Last Date Qty

Ive spent the last 2 days trying to get this, and I really just need a few pointers. Im using Excel 2010 w/ Power Pivot and calculating inventories. I am trying to get the amount sold between 2 dates. I recorded the quantity on hand if the item was in stock.
Item # Day Date Qty
Black Thursday 11/6/2014 2
Blue Thursday 11/6/2014 3
Green Thursday 11/6/2014 3
Black Friday 11/7/2014 2
Green Friday 11/7/2014 2
Black Monday 11/10/2014 3
Blue Monday 11/10/2014 4
Green Monday 11/10/2014 3
Is there a way to do this in dax? I may have to go back and calculate the differences for each record in excel, but Id like to avoid that if possible.
Somethings that have made this hard for me.
1) I only record the inventory Mon-Fri. I am not sure this will always be the case so i'd like to avoid a dependency on this being only weekdays.
2) When there is none in stock, I dont have a record for that day
Ive tried, CALCULATE with dateadd and it gave me results nearly right, but it ended up filtering out some of the results. Really was odd, but almost right.
Any Help is appreciated.
Bryan, this may not totally answer your question as there are a couple of things that aren't totally clear to me but it should give you a start and I'm happy to expand my answer if you provide further info.
One 'pattern' you can use involves the TOPN function which when used with the parameter n=1 can return the earliest or latest value from a table that it sorts by dates and can be filtered to be earlier/later than dates specified.
For this example I am using a 'disconnected' date table from which the user would select the two dates required in a slicer or report filter:
=
CALCULATE (
SUM ( inventory[Qty] ),
TOPN (
1,
FILTER ( inventory, inventory[Date] <= MAX ( dates[Date] ) ),
inventory[Date],
0
)
)
In this case the TOPN returns a single row table of the latest date earlier than or equal to the latest date provided. The 1st argument in the TOPN specifies the number of rows, the second the table to use, the 3rd the column to sort on and the 4th says to sort descending.
From here it is straightforward to adapt this for a second measure that finds the value for the latest date before or equal to the earliest date selected (i.e. swap MIN for MAX in MAX(dates[Date])).
Hope this helps.
Jacob
*prettified using daxformatter.com

Conditional vlookup in Excel

I have a table where the first column is name, and second column is value. The value can either be a 0 or one of pass/fail. I also have time stamps so names can repeat. For example,
Column1 Column2 Column3
X 0 12AM
X Pass 3AM
I am trying to do a vlookup to get the pass/fail status. But since I do not know if the 0 will come first or after (and I cannot control the sorting of the lookup table); I need to write a formula that would automatically do a conditional and pick the pass/fail but not the 0. Also - I can't lookup on the time as it changes every x minutes and not available on the main table.
Any clues?
I know there are ways to pick the nth item from a vlookup; however, I can't figure out how to get this scenario as the pass/fail won't always be the second one, for example.
If I understand you correctly, I think you actually want to use =INDEX with =MATCH() as an array formula here.
I added to your fake data:
A B C
Panda 0 12AM
Panda pass 3AM
Panda 0 5AM
Koala fail 2AM
Koala 0 1PM
Koala 0 3PM
Polar 0 12AM
Polar pass 9AM
You'll get this:
E F
Panda pass
Koala fail
Polar pass
In column F where the results are, place this formula and hold down [control] and [shift] and hit [enter]. It won't work if you just hit [enter].
=IFERROR(INDEX($B$2:$B$9,MATCH(E2&"pass",$A$2:$A$9&$B$2:$B$9,0)),INDEX($B$2:$B$9,MATCH(E2&"fail",$A$2:$A$9&$B$2:$B$9,0)))

Resources