how can i put data in list view month wise in android? - android-listview

I want to show data in database as month wise. Means the number of activities done by user for particular months display in particular month.
Like,
1 April 2013
List item 1
List item 2
List item 3
2 May 2013
List item 1
List item 2
List item 3
the data are coming in list-view from database. How can i do this, If anyone knows please help me.

You can sort the date first using Comparator and Collections.sort and then populate the listview as per each month. You can also check number of months have data and populate only those listviews. But Best way to solve this problem is by using expandable Listview. Check this link
Expandable Listview
For Sorting by Date
I hope it will atleast give you idea to start work on.

Related

Finding rows with matching id's and the using the date fields in each row to find the time difference in days between them

I have rows of data where up to 3 id's match. I need to try and find the number of days between each of the rows with matching id's using the date field. I am looking to find the number of days between each row in date sequence. So between the first and second row in date sequence, or second and third row but not the first and third row.
So a simplified version of my rows can be seen in the attached image.
image showing 2 ID's with multiple entries. John Smith (highlight yellow) who has 3 entries, two on the same day and one later and Bill Wright who has just two entries on separate days.
The results I would be looking for would ideally be shown in column 4 of the image.
Is there any way I can do this in a formula or pivot table? (basically avoiding VBA) Any suggestions hugely appreciated! Thanks.
This array formula
=IFERROR(B2-INDEX($B$1:$B$9,MAX((A2=$A$1:A1)*ROW($A$1:A1))),0)
will work as long as your data are sorted by date (which your screenshot indicates they are):

Tableau dashboard filter action excluding date but including clients represented in date clicked

I have a bar chart below that shows the sum of clients by month. I want to be able to click on a month and use a dashboard action to navigate to all data for each of the clients represented in the month that was clicked. Basically, I want to exclude the date portion of the filtering.
I currently do this by navigating to a sheet that includes client_id and filters for the single month and then I select all client_ids and action to another sheet that filters by the selected client_ids and not date. I want to remove the middle step.
If the above selected month is April 2020 and represented 64 clients, my current action takes me to a sheet that has each client on a row and shows me their sum of invoices for April 2020. I want to see those same 64 clients for all months they have transactions in.
This one may be tough to accomplish, but I definitely see what you're setting out to do. If you're using a date dimension on your action it will use that data to filter.
However, there may be some other options depending on what you're needing. If don't need to see the invoice ids and only want to see the sum of invoices for all months you could use a LOD (Level of Detail) calculated field.
You would create a calculated field like:
{ FIXED [client_id] : SUM([your invoice amount measure])}
Use this as a new column to get the sum of all invoices in your data set for each client.

ListView: instantly updating and time comparision

I have to work on an application in which we are getting list of orders(with all details and display_time) and we have to show them in list view, but the condition is we have to show particular order on their exact display_time.
For example below are some orders with display time:
order_id: 101 |
display_time (hh:mm:ss): 09:10:00
order_id: 102 |
display_time (hh:mm:ss): 09:30:00
Then the requirement is:
We have to show the orders on list on exact their display time.
All order should come instantly as they entered in database.
Edit
The first thing that I need is:
To get the order from database (SQL Server) instantly without hitting
any API. Like push notification.
Then the second need is:
To compare the device's time and order's display_time and if its matched then make visible the order in ListView. I have to do this for each order i think.
I don't know how can I do this.
So please suggest how can we do the above task.
I hope I understand correctly. Mainly you want the list of items to be in the order of time from earliest to latest.
Here is one algorithm and it could be enhanced.
Allocate 100 (arbitrary) items/rows in the Listview.
If you only have 2 items or orders initially, make the other 98 rows not visible (state).
If a new order is entered, add the new order into one of the non-visible rows. And make it visible of course.
The issue in this case, you may have to reorder the items above the new order. However this is only a manipulation of text in your rows. A data structure is necessary to support this.
I claim this algorithm is fast. I think this is a good start.

How do I find data against a date for an item from another work sheet

How do I find data against a date for an item from another work sheet. I am unable to use vlookup or Hlookup as that Item number has multiple number of data for different week date. For eg on the first sheet I have item ABC and I want data for that same item against date 01/13/2014 and 01/20/2014 from another sheet. How do I Pull exact cell data for that item.
This is how i got this working.
=INDEX(Sheet2!A$1:H$9,MATCH(A2,Sheet2!A$1:A$9,0),MATCH(B2,Sheet2!A$1:H$1,0))
The idea is to match the index by matching the intersection of your item number in row and your week date in column in sheet2. You would get #N/A as well but ignore those.
Hope this helps. Enjoy!!!

Access Crosstab or Form based on 2 tables with dates

There are a few answers here already that have part answered my challenge in Access but not fully.
I have 2 tables that form the basis of my database: customers and items
I have a further 2 tables; one for order quantities against customers and items (orders_a), and one for forecast quantities against customers and items (forecast_a).
forecast_a and orders_a also have a date for each customer and item combination (basically there will be 12 dates only for the 12 months of the year - 01/01/12,01/02/12,01/03/12 etc.)
Because a user will want to manually forecast quantities for a full year for each customer and each item, if there were 2 customers and 2 items, the forecast_a table would contain 48 rows. 2 items x 2 customers = 4, 4 x 12 dates = 48. The same goes for the orders_a.
I know this is a slightly unusual set up but the user requires visibility of a full year.
My main challenge based on this is as follows:
A user will want to see a form with customers in the first column, items in the second and then (like a crosstab): Jan Forecast Qty, Jan Order Qty, Feb Forecast Qty, Feb Order Qty etc.
Therefore how would I create a crosstab to pull both these tables together, and how would I go about creating a form for data entry off the back of it?
I may well be constructing my database the wrong way but the fact that the user needs a 'grid' where every entry is manual means I can't just have a form that creates a record one at a time for orders or forecasts.
Thanks in advance!
Nick
The problem you have is that this is a task that is in essence a spreadsheet task. Accordingly it may be best handled in Excel. To achieve this create an Excel object, create a blank worksheet, populate it with the data, then have a button to suck it back into the database when the user has finished.