Dojo financial calendar - dojo

I'm using dojox/calendar/Calendar in the "month" view, and I'd like to adjust the start/end days of the month to match up with my company's fiscal or marketing calendars.
In these Fiscal/Marketing Calendar Month-views, I'd like to see something like this (note the square brackets indicating the beginning and ending of the fiscal month):
S M T W T F S
19 20 [21 22 23 24 25
26 27 28 29 30 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19] 20 21 22 23
Basically I want a normal Gregorian calendar, but with the month shifted to put a non-standard date as the beginning and end of the month-view. I see various "alternate calendars" such as dojox/date/hebrew, but I'm not certain as to whether implementing my own "date" object is the right way to proceed.

Related

Total of Various Columns as a Separate Column in Oracle

Could you help me out with an issue I have in Oracle?
Let's say I have a table that tells me about how many items were sold in each month, and looks like so:
Item
January
February
March
April
Computer
3
5
2
9
TV
10
12
16
14
Camera
22
25
20
27
What I need in the output is a table that would count the total number of items sold over the period, and would look like this:
Item
January
February
March
April
Total
Computer
3
5
2
9
19
TV
10
12
16
14
52
Camera
22
25
20
27
94
I am honestly not sure how to do that. Should I use grouping()?
Thank you in advance.
You don't need to use grouping at all just try to plus all columns as a new column Total.
SELECT T.*,
(January + February + March + April) Total
FROM T

yearly average from monthly daterange data

I have the following table in postgresql;
Value period
1 [2017-01-01,2017-02-01)
2 [2017-02-01,2017-03-01)
3 [2017-03-01,2017-04-01)
4 [2017-04-01,2017-05-01)
5 [2017-05-01,2017-06-01)
6 [2017-06-01,2017-07-01)
7 [2017-07-01,2017-08-01)
8 [2017-08-01,2017-09-01)
9 [2017-09-01,2017-10-01)
10 [2017-10-01,2017-11-01)
11 [2017-11-01,2017-12-01)
12 [2017-12-01,2018-01-01)
13 [2018-01-01,2018-02-01)
14 [2018-02-01,2018-03-01)
15 [2018-03-01,2018-04-01)
16 [2018-04-01,2018-05-01)
17 [2018-05-01,2018-06-01)
18 [2018-06-01,2018-07-01)
19 [2018-07-01,2018-08-01)
20 [2018-08-01,2018-09-01)
21 [2018-09-01,2018-10-01)
22 [2018-10-01,2018-11-01)
23 [2018-11-01,2018-12-01)
24 [2018-12-01,2019-01-01)
25 [2019-01-01,2019-02-01)
26 [2019-02-01,2019-03-01)
27 [2019-03-01,2019-04-01)
28 [2019-04-01,2019-05-01)
29 [2019-05-01,2019-06-01)
30 [2019-06-01,2019-07-01)
31 [2019-07-01,2019-08-01)
32 [2019-08-01,2019-09-01)
33 [2019-09-01,2019-10-01)
34 [2019-10-01,2019-11-01)
35 [2019-11-01,2019-12-01)
36 [2019-12-01,2020-01-01)
37 [2020-01-01,2020-02-01)
38 [2020-02-01,2020-03-01)
39 [2020-03-01,2020-04-01)
40 [2020-04-01,2020-05-01)
41 [2020-05-01,2020-06-01)
42 [2020-06-01,2020-07-01)
How can I get yearly average from monthly data in postgresql?
Note: Column Value is type integer and column period is type daterange.
The expected result should be
6.5 2017
18.5 2018
30.5 2019
39.5 2020
If your periods are always taking one month, including the lower bound and excluding the upper, you could try this
select
avg(value * 1.0) as average,
extract(year from lower(period)) as year
from table
group by year

How to calculate maximum of three in combined query

usage
The image shows works that I have done in access. The query "overall usage review" count the number of usages in each month by using combined query.
After this step, I want to show the maximum three of usage.quantity among 12months and calculate with the formula ( E.g., "Total MAX three months usage"/3)
E.g.,
Warehouse Part Number ........................................................
A X01 9 16 7 14 10 5 9 11 6 3 11 5
A X02 20 22 10 12 20 17 18 29 14 13 11 19
B X01 8 7 3 26 17 6 3 2 5 10 8 14
B X05 9 10 16 6 10 4 13 12 6 4 3 6
I want to result it as below...
Warehouse Part Number Maximum three usage quantity Results
A X01 41 41/3
A X02 71 71/3
B X01 57 19
B X05 39 13
Someone told me to use dynamic sql, but I dont know what it is... Pls tell me how to solve this problem in detail. The problem stuck in my mind for a very long time...

How to programmatically layout days in a calendar in a way that matches the month and day of the week?

How can I do this?
I'm sure this has been done before. I've checked a couple of projects on github, such as calendar master, but they are all more complicated than what I need.
Oct 2013
S M T W T F S
30 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3
Is there a best approach to do this? To layout days in a way that will match the day of the week for that month?
This will be made in a tableview, but I'm not looking for code, just the logic behind it. Unless there's a really good solution out there already.
Thank you!
The logic could be something like this (pseudo code):
get the weekday of the first day of the month in question
determine the number of days of the previous month
fill the first line
with leading final days of previous month, if any
the remaining days for the first week of the month in question
fill all other lines
fill the rest of the last line
with the first days of the following month, if any space left

Create a Multi-Column Report Using DevEx Grid

I have a daily sales report query and it have 2 columns like
days sales
1 12
2 65
3 25
...
30 24
but when I want to print it there is a lots of free spaces on paper, so I want to seperate query with a percentage (like % 33)
and result will be like 3 x 2 columns for one paper. and it will be more comfortable for me.
days sales days sales days sales
1 12 11 21 21 5
2 65 12 53 22 18
3 25 13 0
...
10 45 20 12 30 55
Any way to do this with DevEx Grid?
this is the view which I get
and I dont want such kind of empty paper for couple of records..
You will not find an easy way to achieve the desired result using XtraGrid, because it is not intended for reporting. I suggest that you create reports using another product: XtraReports.