Rate issue in Trade agreement journal - axapta

I have created multiple journals for an item (suppose "item1") in AX2012 with multiple rates and different from and to date.
Like for Journal 1, From date is set as 1/12/2013 and to date is NULL and rate as 50.
for journal 2, From date is set as 7/12/2013 and to date is NULL and rate as 60.
Now, logically when selecting item in sales line form on or after 07/12/2013, I must get unit price 60. But unit price that i am getting is 50.
How to get latest price of an item, account, to, from date in sales line form?

It is valid in AX to have more than one active price record (PriceDiscTable).
In your case both 50 and 60 are valid rates, it then does the service of choosing the lesser one!
In journal 2 you should find the old rate, then apply an end date of 06/12/2013.
As this is cumbersome, it is a usual customization to auto-close prices. This could be done in the insert method of PriceDiscTable.

Related

values calculated from all previous rows

Entries =
a single value corresponding to an initial stock of goods (eg. 5)
an excell file with three columns
-- date
-- a production of goods for that date (eg. 10)
-- a request for goods for that date (eg.20)
I need for each date to calculate =
the sold quantity = minimum [stock on previous date + production ; request]
(in the eg.15)
the new stock = previous stock + production - sold quantity
(in the eg. 0)
On next date a new calculation based on new production and new request is to be done.
I have no problem to do in the Excell sheet but I cannot manage to do it integrating the entry file with Dax.
Thanks a lot for ideas you may have.
I tried Dax formula to get data from the date before it works.
But the trick here is the stock for a date depends on sold quantity and stock from all previous dates.

Power BI - How do I get the Status correct based on the columns I add or remove

Am stuck in a situation that I cant seem to solve, still learning so would appreciate if you could tell me what am I doing wrong and how do I get this right? It seems simple, but not for me anymore.
Background:
ACME company sells products in various cities and I need to check if ACME is Cheaper, Same or Expensive in terms of pricing. The same product may be sold in 10 different stores in a city and we want to know:
How is ACME doing for each product by City or by Store and I
calculate that as follows:
For each City:
List all the instances of that one product (lets say that product was sold in 10 stores in Dallas,so 10 instances,which means we may have 10 different store prices
Then return the minimum price of these 10 prices
Compare this minimum price against the ACME price and determine whether the product is Cheap, Same or Expensive
Formula:
Measure to calculate min price = 1 Min Price = CALCULATE(MINX(Data,Data[Store Price]),ALLEXCEPT(Data,Data[Barcode],Data[City],Data[Match Type],Data[Store]))
Calculated Column to detrmine status = 2 Price Status = if(Data[ACME Price]<[1 Min Price],"Cheap",if(Data[ACME Price]=[1 Min Price],"Equal","Expensive"))
Problem to be solved:
Screenshot 1 - When i have stores listed along with City, then the formula should consider the Store column and give me minimum price per Store (basically it will do a row by row comparison as a a store will show only once per city) which is what its doing in the "Min Price" and also the status is correct
Screenshot 1 - With Stores
[
Screenshot 2 - When I remove stores, the "Min Price" column is showing the right minimum price for a product per city, however the Status is incorrect - for product ending 7572, both the status must be Equal and for product ending 3566, it should be Expensive
Screenshot 2 - Without Stores
Can someone please advise what am I doing wrong? How do i get the status right when viewing by City?

Find observations of an ID within a certain timeframe in the future in Tableau

I have a dataset in Tableau that contains sales data listing each sale the company has had in the past year. Each customer has a unique ID, and many customers return. I'm trying to figure out how to create a calculated field in Tableau that gives a True | False answer to whether a given patient ID appears again in the dataset within a given timeframe (say, within six weeks of a given observation).
I've tried running it with LOOKUP, but I haven't been able to specify the increase in time effectively.
This would be how I would approach it. Create two date parameters, start and end.
Then create a filter calc for the date.
[date] >= [param_date_start]
and
[date] <= [param_date_end]
Place this in the filter shelf set to TRUE.
Then create another parameter for your customer id and you can test for the existence of a customer id as follows.
max([customer_id] = [param_customer_id])
This will return true if there is at least one record where the customer_id equals the param_customer_id for the chosen dimensions and date range.
You could use this same approach to define a computed set, say the set of all products that were purchased by the customer in the specified date range, or the set of all patients that received a particular service. Just use this formula on the condition tab when defining the set.

How to get the lowest price of products?

Table structure
The above Table have 10 products with various price from 3 suppliers. I need to pick the supplier who can give the lowest price.
Just i tried with MS Access 2013. I unable to get the lowest price. Your valuable guidance is much appreciate one.
SID = Supplier ID
PCODE = Product Code
Thank you very much for your time
I assume cheapest means lowest per-ml price per item
So do the following:
create a query#1 that includes the product, supplier, whatever other
fields you want in the final answer, and a calculated field of the
per-ml price.
create an aggregate query #2 on query#1, which groups by product and gives the min per_ml_price. Now you have a "table" with the cheapest price for each product.
Lastly, you want to find the data that matches the lowest price. (Inner-)Join query#2 and query#1, and output the fields you want (product, supplier, etc.)

Crystal reports, get sum for specific reocrds

In Short:
I need to get a total for customer groups + the credits - the debits in a specific date range.
In Detail:
I'm creating an invoice report for customer orders. Each Customer belongs to a group, and I need to group the invoice by customer group so I can give a total amount owed for the customer group.
So the top Group in the report is customers.group_name with the total for the group in the group header.
The second group is orders.customer_id with the total for the customer in the group header.
I have 2 parameter for the date range of orders which I use in the select expert
I have another table for credits and debits for each group.
This are the fields for the CreditDebits Table
group_name
date_
type_ (this can be either "credit" or "debit")
amount
I've linked customers.group_name with CreditsDebits.group_name in the database expert.
I also use the date range parameters for this table
Do get the credits I created a formula called "credists" like so
if {Credits_Debits.type} = "credit" then sum({Credits_Debits.amount})
But when I drop this formula on the customers.group_name header, the formula shows up as empty and the total for the group gets messed up (it becomes triple of what it should be.
What am I doing wrong?
First check Does this field CreditsDebits.group_name consists of customer name? or any different name?
Place the formula if {Credits_Debits.type} = "credit" then sum({Credits_Debits.amount}) in footer but not in header and check.

Resources