Filter in Excel 2016 using the same date range on multiple columns - filter

I'm trying to display rows when any of the columns B, C, D, E, or F has a date no more than 10 days old. It doesn't matter if any of the other columns have dates more than 10 days old.
I tried advanced filters and filter on filter but if there is a date in any of the columns more than 10 days old it won't display the row.
Any help is appreciated.
A B C D E F
1 Item Submitted to Ann to Joe from Ann from Joe
2 381-02 07/06/18 07/06/18 07/24/18
3 480-00 06/29/18 06/29/18 07/24/18 07/24/18 07/25/18
4 483-00 07/02/18 07/03/18
5 490-00 07/06/18 07/07/18 07/24/18 07/25/18 07/25/18
6 491-00 07/06/18 07/07/18 07/24/18
7 492-00 07/06/18 07/07/18
8 493-00 07/10/18 07/10/18 07/25/18 07/26/18
Display the row if any date in these columns (D-H)
is greater than 10 day from today.

If you are looking to do this without vba and only use ecxel function then you need to make a nested if (in a new column) and use the OR operator. So in the end if any of the cells in the rows is greater then 10 days write 1 if false write 0
And just sort your new column by 1

Related

Sort Column header based on row value, and show as columns

We have sheet with column names and values in the cells below.
We like to have a list of the names and the value next to it ordered.
example.
A
B
C
D
E
1
John
Mary
Tom
Grace
2
3
4
5
2
and we would like the same data below which looks like...
A
B
1
Tom
5
2
Mary
4
3
John
3
4
Grace
2
Any ideas? Thanks
use:
=SORT(TRANSPOSE(A1:D2), 2, )
or:
=SORT(TRANSPOSE({A1:D1; A4:D4}), 2, )
SUGGESTION
Perhaps you can try this way:
=QUERY(TRANSPOSE(A1:D2),"SELECT * order by Col2 DESC")
Sample Sheet
Reference
TRANSPOSE
QUERY

FIFO inventory aging report using a single query in T-SQL

I've got an inventory transactions table :
Product
Date
Direction
Quantity
A
Date 1
IN
3
B
Date 2
IN
55.7
A
Date 3
OUT
1
B
Date 3
OUT
8
B
Date 3
IN
2
I can easily get the stock for any date with the following query :
SELECT Product,
SUM(CASE Direction WHEN 'IN' THEN Quantity ELSE -1 * Quantity END)
FROM Transactions
WHERE Date <= '#DateValue#'
GROUP BY Product;
Now my purpose is to get stocks aged like this using the FIFO principle :
Product
Total stock
0-30 days
31-60 days
61-90 days
91+ days
A
3
3
0
0
0
B
34.2
10
14.2
7
3
C
25
20
3
1
1
D
10
2
8
0
0
E
1
0
0
1
0
I am using SQL Server 2016 & SSMS 18.
The solution should be fast as it will be working against a table with 3,000,000+ rows.
A single query is preferred since it will be integrated into an ERP system.
I have yet to find a solution based on a single query after weeks of research. Any help is appreciated. Thanks in advance.

Running distinct count in quicksight

I want to implement a running distinct count with Amazon Quicksight. Here's an example of what that would look like:
Date
ID
Amount
Running Distinct Count
1/1/1900
a
1
1
1/2/1900
a
3
1
1/2/1900
b
6
2
1/4/1900
a
3
2
1/8/1900
c
9
3
1/22/1900
d
2
4
I've tried runningSum(distinct_count, [Date ASC]), but this returns a sum of the distinct counts for each aggregated date field.
Can this be implemented in QuickSight?
You can use this workaround to get the same functionality as runningDistinctCount() as follows:
runningSum(
distinct_count(
ifelse(
datetime=minOver({Date}, [{ID}], PRE_AGG),
{ID},
NULL
)),
[{Date} ASC],
[]
)
This would give you the runningDistinctCount of ID's over the Date field. It achieves it by considering just the first time the ID appears in the dataset, counting these and finally doing a runningSum on these counts.

Multiple tablix for report

i have the following scenario i am trying to simplify using Visual Studio and Microsoft BI Stack (SSRS).
I have a Dataset as follows.
Year Employee Sales
1 A 5,000,000
2 A 7,500,000
3 A 6,500,000
1 B 3,500,000
2 B 5,000,000
3 B 8,000,000
1 C 5,750,000
2 C 7,500,000
3 C 6,500,000
1 D 4,500,000
2 D 5,500,000
3 D 6,100,000
I am trying to create a report whereby, a single report would span 3 Tablix inside report body when run to display as follows.
Year 1
Year Employee Sales
1 A 5,000,000
1 B 3,500,000
1 C 5,750,000
1 D 4,500,000
Year 2
Year Employee Sales
2 A 7,500,000
2 B 5,000,000
2 C 7,500,000
2 D 5,500,000
Year 3
Year Employee Sales
3 A 6,500,000
3 B 8,000,000
3 C 6,500,000
3 D 6,100,000
Now i know i could replicate the Tablix 3 times in the report body, but that would be a bad idea when it comes to maintaining this report.
In the effort to avoid repeating myself, is there a way to loop the Tablix (N Times) in SSRS where condition would be the Year column (values 1, 2, 3.....)?
Following are the steps :-
Insert a List. Group it by the Year.
Put your tablix inside the list.
This should do it.
What you want to do is to NEST two tables.
First, create your table that gives you all the results like you want.
Then create a second table with one column and one row and Group it by your Year field.
Place your first table in the second table's so that it repeats for each year.

Hive Script - How to transform table / find average of certain records according to one columns name?

I want to transform a Hive table by aggregating based on averages. However, I don't want the average value of an entire column, I want the average of the records in that column that have the same type in another column.
Here's an example, easier than trying to explain:
TABLE I HAVE:
Timestamp CounterName CounterValue MaxCounterValue MinCounterValue
00:00 Counter1 3 3 100:00 Counter2 4 5 2
00:00 Counter3 1 4 1
00:00 Counter4 6 6 100:05 Counter1 3 5 200:05 Counter2 2 2 200:05 Counter3 4 5 400:05 Counter4 6 6 5.......
TABLE I WANT:
CounterName AvgCounterValue MaxCounterValue MinCounterValue
Counter1 3 5 1Counter2 3 5 2Counter3 2.5 5 1Counter4 6 6 1
So I have a list of a bunch of counters, which each have multiple records (one per 5 minute time period). Every time each counter is logged, it has a value, a max value during that 5 minutes, and a min value. I want to aggregate this huge table so that it just has one record for each counter, which records the overall average value for that counter from all the records in the table,and then the overall min/max value of the counter in the table.
The reason this is difficult is because all the documentation says is how to aggregate by the average of a column in one table - I don't know how to split it up in groups.
Here's the script I've started with:
FROM HighCounters INSERT OVERWRITE TABLE MdsHighCounters
SELECT
HighCounters.CounterName AS CounterName,
HighCounters.CounterValue AS CounterValue
HighCounters.MaxCounterValue AS MaxCounterValue,
HighCounters.MinCounterValue AS MinCounterValue
GROUP BY HighCounters.CounterName;
And I don't know where to go from there... any ideas? Thanks!!
I think I solved my own problem:
FROM HighCounters INSERT OVERWRITE TABLE MdsHighCounters
SELECT
HighCounters.CounterName AS CounterName,
AVG(HighCounters.CounterValue) AS CounterValue,
MAX(HighCounters.MaxCounterValue) AS MaxCounterValue,
MIN(HighCounters.MinCounterValue) AS MinCounterValue
GROUP BY HighCounters.CounterName;
Does this look right to you?

Resources