Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
can any one help me on the following scenario, I have 3 fields Design Date, Sale Date Item , Sale, by using these three fields I would like to calculate Total Months count for each Item from Design date and cumulative sum of Sale for each item to Sale date.
Thanks
John
Unable to get the results in months, but for days may be this:
Table:
LOAD [Design Date],
[Sale Date],
Item,
Sale
FROM
[Testdata (3).xlsx]
(ooxml, embedded labels, table is Sheet1);
Concatenate(Table)
LOAD Only(Item) as Item,
Date(Today()) as [Design Date],
Date(Today()) as [Sale Date],
0 as Sale
Resident Table
Group By Item;
Join(Table)
LOAD Min([Sale Date]) as [Min Sale Date],
Item
Resident Table
Group By Item;
FinalTable:
LOAD *,
[Sale Date] - [Min Sale Date] as DaysDifference,
If(Item = Peek('Item'), RangeSum(Peek('Cumulative Mileage'), Sale), Sale) as [Cumulative Mileage]
Resident Table
Order By Item, [Sale Date];
DROP Table Table;
Can you update the excel with your desired output to understand what exactly you are looking for?
Sure
Here you go. Check the qvw attached:
Good Job
I assume this is what your looking for
Updated
1. total months for each item, Monthdiff(DesignDate,SaleDate)
2. For cumulative sum, please share the sample output, what you are looking for..?
Count is Correct But Sale is not tied , need to work on this , thanks.
I'll see what I can do
Maybe Sales is:
= max(Aggr(sum(Sale),Item))
Or this:
= aggr( NODISTINCT sum(Sale), Item )
You choose