In My spreadsheet, I want to count how many invoices are not paid and overdue. So for that I Count tose who are not paid like this:
=COUNTIF(F4:F256, "nein")
But how can I make a condition only count if "date" is lower than today? Normally I would iterate over it but don't know how in the spreadsheet.
The table looks for example like this:
try it like this:
=COUNTIFS(F4:F256; "nein"; E4:E256; "<"&TODAY())
Related
I've tried to find a similiar thread on this, but have not been able to do so. Im pretty new to Power BI, so i might not know what im looking for. I could really use some advise.
I have a sales table ('SalesTable') that contains all the sales from different store locations. The table includes all the sales from each store beginning in january 2021, but the stores was incorporated on different dates in 2021, and so i need to be able to make a filter to only return the sales for each store from when the stores was incorporated respectivaly.
Simplified, the tables looks like this:
'SalesTable'
'SalesTable'
'Stores'
'Stores'
The two tables are joined on storeID. SalesTable is also connected to a dax-created Calender table. The stores table is not connected to the calender table (Maybe it should??).
I need to be able to filter the report so that it only returns sales dated on or after the respective incorporateddate.
Like this:
'Desired output'
I am not sure whats the optimal way to go about this. If i should make a calculated table of the SalesTable, or if a measure is sufficient to filter the report. Any suggestions, tips or solutions would be highly appreciated :)
You can use this measure:
sumIncorp =
var __maxIncorp = CALCULATE(max(inc[IncorporatedDate]), FILTER(inc, inc[StoreID] = SELECTEDVALUE(IncSale[StoreID])))
return
CALCULATE(SUM(IncSale[Amount]), FILTER(IncSale, IncSale[Date] >= __maxIncorp))
Sorry for the convoluted title, but I find it to be a convoluted propblem
I have two lists, one of dates and one of counts pr. date.
Like this:
I would like it to end up like this:
where the dates have been moved to their corresponding cell, according to the time between the two dates.
I would prefer it to be doable in Google Sheets, but if thats impossible, Excel would suffice.
Anyone have a clue of how to this?
You can create the sequence of all dates as proposed by #BigBen in the comment using SEQUENCE like this
=SEQUENCE(MAX($A$1:$A$3)-MIN($A$1:$A$3)+1;1;MIN($A$1:$A$3))
And then in the next cell you can insert the following formule
=ArrayFormula(IFERROR(VLOOKUP($C$1:$C;{$A$1:$B$3};2;FALSE)))
How do I populate the number of purchases and sales per day in tableau?
Here is my Sample Data:
In my first attempt, sales numbers are not counted to the exact date.
In my second attempt, I tried to tabulate by dropping sales date into the rows. However, it returned two figures - purchases and sales.
I have also tried Calculated Field but Tableau is unable to do a "for loop" like python.
First attempt:
After dropping Sales Date into the Rows. This is what I get:
Is there any way to populate it like this? Please help, I am still new to tableau. Special thanks to Fabio Fantoni for the first solution!
Desired Format:
I have another sample data (refer to sample data 2) which I would like to populate in the desired format (refer to desired format 2). In Sample Data 2, the purchase date "15/12/2020" is not reflected in sold dates.
My apologies but I may require some guidance as I am still new to tableau. Thank you in advance.
Sample Data 2:
Desired Format 2:
Based on this sample:
In order to bypass your double count for two different date columns, you may want to cross join your original data with a copy of it on original.Purchase = support.Sold, like this:
Doing so, you just have to create two calculated fields:
count Purchase:
count([Purchase Date])
count Sold:
Count([Purchase Date (Foglio11)])
The only thing you have to pay attention to is that in the second calculus you have to count Purchase date due to your "inverted" cross join.
You should get something like this:
I'm a novice Tableau user, trying to help my organization to analyze phone traffic. My data source of incoming phone calls is in an Excel spreadsheet, and is listed like this:
TRANSACTION ID DATETIME
151313:179805 1/2/2018 9:57
151340:108017 1/2/2018 17:27
151395:176211 1/3/2018 15:27
Our total calls per day range from 10 to 50.
I'd like to count days with an identical # of calls, and probably make a Histogram sorted by # of calls on the X-Axis, and # of days w/ that many calls on the Y-Axis.
I feel like this would be a simple Calculated Field, but for the life of me, I'm not getting what I'd do here.
Help! :)
One solution is to define an LOD calc, calls_per_day, as
{ FIXED DateTrunc('day', [DATETIME]) : COUNT("*") }
which in effect, prebuilds a little table in space showing the number of data rows for each day. That works if you have one data row in your input per transaction id.
If transaction ids are repeated, and instead you want the number of transactions for each day, you can use the following variation.
{ FIXED DateTrunc('day', [DATETIME]) : COUNTD([TRANSACTION ID]) }
COUNTD() can be expensive on large data sets, so its better to use an alternative when you have the option.
You can use LoD
{Fixed TRANSACTION ID : Count(Day(DATETIME))}
Try this and post the result
I'm building an html table with dates as columns and hotel rooms as rows.
I'm fairly new to Meteor and have had headaches over this.
Because a html table is build by rows, I need to iterate over the rooms. So, if I am not mistaking this limits me to choosing the following file structure in MongoDB:
Room Collection:[
{Room1:[{"31/03/2015", "2/04/2015",....]},
{Room2:["22/03/2015",...]},
...]
Before this I had a reservation object where every reservation had the name of the room in it. Because there is no way I can group these dates over different collections, I changed it to the above structure.
So, okay, now I am able to move the cursor from room to room and build table rows.
Bigger problem now is that I then would iterate over 7 days (lets just say, for now I only retrieve queries for the current week). If I now get three days back from the database that are booked. I am only able to loop three times. Which is bad news because I need to fill 7 td elements. So somehow I should Identify which days of the week are taken by the reservation.
Is it a possibility to just store every date of the year in MongoDB and indicate wether there is a booking for that date? That seems far from elegant.
Or should I compare the dates of the week with the dates retrieved from the server, so on the client side?
I think I am looking at this problem the wrong way. I would love to here somebody else's opinion on this. :)
Kind regards
I always start off with an ER model of what I have & what I want.
How I think you currently have it: 1 Room has many Reservations. 1 Reservation has 1 datetime.
How you want to access it: 1 Day has many Reservations. 1 Reservation has 1 datetime & 1 room.
The Mongo way to do it: 1 Reservation has 1 room & 1 date.
So your original idea was correct (I'm not sure what you mean by not being able to group in other collections, we can tackle that in comments if you like):
Reservations = {
name: 'The Johnson Family Reunion',
room: 'Grand Ballroom',
datetime: new Date
}
For simplicity, we'll assume you aren't changing months in this example & I assume you've already got the code down to assign days to those squares.
Each square in the calendar should follow a dayofMonth template.
That will afford you a this that has the date in your helper, so you can write something like this:
Template.dayOfMonth.helpers({
reservations: function() {
return Reservations.find({datetime.getDate():
this.datetime.getDate()}).sort(datetime);
}
}
Then, your template is something simple like:
{{#each reservations}}
{{reservations.name}}
{{/each}}
Hope it helps!