Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Can any one please help me on below requirement.
I have a date field like below in DD/MM/YYYY format.
In the Year 2018 I have the Jan to Dec Months Data.
In one bar chart I have to show first 6 months data i.e., from jan to Jun only.
In another bar chart I have to show last 6 months data i.e., from July to Dec.
I have calculated Month Name as
MonthName(Date) as [Month Name]
Please help me to write the expressions for first 6months restriction and Last 6 motnhs restriction.
Thanks in advance.
Try like this -
= only({<Year = {'Jan','Feb','Mar','Apr','May','Jun'}>}Date)
Thank you!
Hi,
I am looking for last 6 months restriction in my set analysis like below.
=Sum({<YearMonth={">=$(=date(addMonths(Max(YearMonth),-6))) <$(=Max(YearMonth))"}>}Sales)
But due to month issue its not working
What is the format of YearMonth? I always over think to use only dates instead string of another format
=Sum({<DateField={">=$(=AddMonths(Max(DateField),-6)) <$(=Max(DateField))"}>}Sales)
Can you show some sample of your output?
What you want to show in your chart.
Thank you!
Hi Anil,
Thanks a lot for your reply. Its working fine. Could you please help me to write first 6 months restriction formula i.e., from jan to Jun.
hi,
if your excluded months are fixed you can directly exclude with below.
sum({<Month -= {1,2,3,4,5,6}>}Sales)
Hi,
Try this
=Sum({<MonthName={"Jan","Feb","Mar","Apr","May","Jun""}>}Sales)
and
=Sum({<MonthName-={"Jan","Feb","Mar","Apr","May","Jun""}>}Sales)
May be this?
=Sum({<DateField={">=$(=Min(DateField)) <=$(=AddMonths(Max(DateField),6))"}>}Sales)
Hi Anil,
Min(Date Field) will take the very first date in the records
Slightly changing your expression
=Sum({<DateField={">=$(=YearStart(Max(DateField))) <=$(=AddMonths(YearStart(Max(DateField)),6))"}>}Sales)