Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a date field(year-month) and I want to get count of contracts for next 12 months on selecting any date.
How to do it?
Thanks
Saurabh
Hi,
I think it is better to truncate the Time part in the date field since you are not using this, you can do this like below
LOAD comments,
customerNumber,
Date(orderDate) AS orderDate,
orderNumber,
requiredDate,
shippedDate,
status;
SQL SELECT comments,
customerNumber,
orderDate,
orderNumber,
requiredDate,
shippedDate,
status
FROM Orders;
=count({<[orderDate]={">=$(=monthstart(max([orderDate]), 1))
<=$(=monthend(max([orderDate]), 12))"}>}quantityOrdered)
Hope this helps you.
Regards,
Jagan.
Saurabh,
Assuming you want to do this in a chart object, below is a sample expression.
Sum({$<[YearMonth]={'>$(=min([YearMonth])-1)<$(=min([YearMonth])+12'}>} Salary)
Note: Change the filed names according to your script field names.
Regards,
Murali
using set analysis
sum(<field = {'>=($(vSelectedDate))<=(addmonths($(vSelectedDate),12))'}>}Sales)
Hi,
I am selecting a date and on selection. the next 12 months should display in chart along with count of that particular months.
Hi,
I want next 12 months on dimension and corresponding count values on y-axis in the chart.
Yes. You can do that using the Set Analysis.
Can you upload the QVW, so that we can help you with the solution?
I am attaching the qvw. In it, I would like to display next 12 month's values on line chart.
Please send me the image of the solved one as I am having personal edition.
Thanks Saurabh
Hi Saurabh
as far as I understand you want to select a date (let's say Apr- 2013) and get for each next 12 month the result by month (so from Apr -2013 until March 2014)
So put as calculated dimension month like =if(month>=201304, month) -- use your date format
Expression is as usual sum(contracts)
it will display only 12 months
best regards
Chris
Add Month(OrderDate) as your dimension and below as expression.
count({1<[OrderDate]={">=$(=addmonths(monthend(max([OrderDate]))+1,-12))
<=$(=max([OrderDate]))"}>}quantityOrdered)
Hi,
If I select a month and compare it, then I will get that month only. How will I get next 12 months?
Thanks
Saurabh