I want to generate No. Series in Business Central in the following format: C220715001
Where 22 is year number as 2022
07 is month number as July
15 is day number as today is 15-07-2022
001 is the invoice number (first generated invoice)
Is it possible to create a No. Series like this without creating 1 line per day?
That would require some development.
Related
Project
Cost
January
323
Feb
323
I have a table as followed seen above which ROW is month (filtered by a certain project) and values are cost of the project. I want to calcuate the difference between two months, but I am having trouble.
How do I subtract two rows from each other.
In the code I wrote:
Variance = [Cost] - CALCULATE([Cost],PREVIOUSMONTH('Month'[Month))
I get the following error, A column specified in the call to function is not of type date.
Is there a way to manual subtract two months?
The best way to do it is to replace your month with an actual Date value. The first of the month for example. The you should be able to do something like this assuming your month dates are unique: If they are not unique you should create a Dates table (See Microsoft's Guidance on date table) and join.
variance = [Cost] - Calculate([COST],(PARALLELPERIOD(Month[Month],-1,Month)
You can use EARLIER function here but, only when the Months have an Id. Such as
1 Jan
2 Feb
3 March
...
Link for details
However, I would suggest creating a date table and then having a relationship from the date table to your table. By using date table you can easily achieve using in-buit date functions.
I want to compare data from the current period (e.g current month) with the previous period (e.g. last month).
Let's say I have the following dataset:
date
orders
2020-01-01
1
2020-01-02
2
2020-01-03
5
2020-02-01
4
2020-02-02
2
And I want to get:
Jan 2020 Orders
Feb 2020 Orders
Delta Orders
8
6
-25%
Period can be selected by user.
the way I reached your desired outcome is by creating a calculated filed "MoM Change":
percentDifference(sum({ orders}), [date ASC], -1, [])
Also, this tutorial might be helpful: https://learnquicksight.workshop.aws/en/business-level-up.html
I was hoping to upvote the example above as it helped me solve this problem. I'm not yet to a reputation of 15 (how embarrassing) so I can't yet do that. But thank you #chrigu for the help.
In researching this, I found that QuickSight has extended this with a few similar functions. I used this one, which works with less parameters:
periodOverPeriodPercentDifference(measure, date, period, offset))
https://docs.aws.amazon.com/quicksight/latest/user/periodOverPeriodPercentDifference-function.html
There are several other variants for periodTo___ and periodOver___ to check out as well.
I have to present a matrix or tablix on a report which shows the invoices a customer has had in a given month. It needs to display like this. Where each week is a separate column - managed that - then the row grouping is by weekday e.g. Mon, Tues, that way all the invoices should sort in the same proximity.
When I group by the weekday I do not see all the invoices - there may be multiple invoices on a day. When I group by weekday, invoice number then the grid has four lists for each week but offsets the invoices in the row below each other week
I have honestly been working on this for ages and have tried every grouping an sorting I can think of but cannont get this to work. Tried searches but still cant find anything clear to help.
The Datasource is standard, used both SSAS and DAX separately to get data - that is not a problem as data is correct. Not sure how to display this layout in this form:
Week 1 Week 2 Week3 Week 4
Inv Amount Inv Amount Inv Amount Inv Amount
Mon Inv123 50 Inv130 450 Inv912 5
Inv124 500 Inv133 25
Tue Inv125 75 Inv245 75
Wed Inv126 85 Inv156 95 Inv315 15
Inv316 50
Thur Inv166 10
Fri Inv127 9 Inv451 15 Inv915 15
I am working in PowerBI and would like to accomplish this issue using DAX. I have a table structured as follows:
ID Year Cash
3001 1999 1,200
3001 2000 1,000
3001 2001 2,200
3001 2002 1,900
... ... ...
8500 2014 3,520
I am trying to identify the organizations (indicated by the 'ID' column) that experienced decreases in cash for two consecutive years. There are several thousand organizations, and I have data on every organization from year 1999-2014.
I would first calculate a column for the Prior year Cash values e.g. for [Cash Year-1] as:
=LOOKUPVALUE([Cash],[ID],[ID],[Year],[Year] - 1)
I would repeat for -2.
Then I would use an IF statement to calculate the final column e.g. [Cash Trend]:
=IF(AND([Cash]<[Cash Year-1],[Cash Year-1]<[Cash Year-2]),"Declining for 2 years","Other")
I have to work with data retrieved and grouped on a weekly basis (ISO week) and my DB is structured on a daily basis (field: DATE). I need to write down a code which is rolling, so that given the current date, it calculate the week and the retrieve data in the previous 3 weeks, too.
So I write in the WHERE clauses:
TO_DATE(TO_CHAR(DATE, 'YYYYWW')) BETWEEN TO_DATE(TO_CHAR(TO_DATE(running_date, 'YYYYMMDD'), 'YYYYWW'), 'YYYYWW')-3 AND TO_DATE(TO_CHAR(TO_DATE(running_date, 'YYYYMMDD'), 'YYYYWW'), 'YYYYWW')
It doesn't seems to work though.
Any suggestions on how to handle the problem?
Thanks a lot!
You have to subtract 21 days when you want to recive the previous 3 weeks. If you subtract 3 then you recive only the last three days.
You need to use 'IW', not 'WW' as the format mask for ISO week. From the Oracle docs:
IW = Week of year (1-52 or 1-53) based on the ISO standard.
WW = Week of year (1-53) where week 1 starts on the first day of the year and
continues to the seventh day of the year.