Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I'm looking to generate a chart for YTD current year vs YTD last year. I have many values to calculate(Sales, Quantity, Per Country, Per State, Per Region etc.,). Each of this will be having a separate chart.
Can you please help me with a single variable to define YTD current year and another one to define YTD last year.
I would like to use this in the chart expressions.
Thanks,
Best Regards
Sai.
Please check below using this you can create variable and use it in you application
create 2 variable
Considering you have proper date field
1 for YTD like
'=$(>=YearStart(max(datefieldName))<=(date(max(dateFieldName))))'
2 for LY-YTD like
'=$(>=YearStart(AddYears(max(datefieldName),-1))<=(date(AddYears(max(dateFieldName),-1))))'
Regards,
Hello Prashant,
I'm using the below formula. But, it doesn't give me any values
SET vDate_APO_YTD = =">$(=YearStart(max(APORegion.Date))<=(date(max(APORegion.Date))))}>";
SET vDate_APO_YTD_VJ = =">$(=YearStart(AddYears(max(APORegion.Date),-1))<=(date(AddYears(max(APORegion.Date),-1))))}>";
Could you please check if i'm missing anything here.
What is your expression in set analysis????
In chart you have to use those variable
Try like
sum({<dateField={"=$vDate_APO_YTD"}>}Sales)
and
sum({<dateField={"=$vDate_APO_YTD_VJ"}>}Sales)
Note : Please check syntax of expression. I am bad with syntax
Regards,
Prashant
Hello All,
For some reason i'm not able to get the desired result. I'm attaching my test data here for reference can you please have look and suggest me what i might be doing wrong.
I'm looking to get the Sales(2017 YTD) vs Sales(2016 YTD) and also Sales_Total in the same format.
I have seen your post regarding the same topic but, some how i'm not able to follow your suggestions. Can you please help me on this.
YTD:
=sum({<Date={">=$(=Yearstart(today()))<=$(today())"} >} Sales)
Y-1TD-1:
sum({<Date={">=$(=Yearstart(today(),-1))<=$(=AddYears(today(),-1))"} >} Sales)
Hello Robin,
Thanks very much for your response.
The YTD (current year) formula works perfectly but the YTD (last year) gives me same values as YTD current year.