Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I'm stuck in a problem and need help!
Problem: So, I have built a dashboard in which I show the Count of deliveries from last year(whole of 2018) if the current month is January(like it is today) but when we move on to Feb, I'll be showing count for only Jan-2019 and when we move onto March, I'll be showing count for Jan 2019 and Feb 2019(You get the point). This is all fine but now the client also wants to have the ability to view the 2018 records even if we are in Feb-2019 and beyond.
I have added the aforementioned logic in the expression of charts but Now I don't know how to show the data for 2018 when we are in Feb-2019, cos according to my expression if it's Feb, only the count of Jan-2019 will be shown. I am kinda confused here. so any help will be hugely appreciated as need to get this done quickly.
Cheers,
Pranav
Sum({<YEAR = {"$(=Max(YEAR) - 1)"}>} value)
u can try
Hi Pranav,
Write your expression like below.
Sum ({<Date={'=>$(=Addyears(Yearstart(max(Date),-1)) )<= $(=max(Date))'}>}Sales)
Thanks & Reagrds,
Arvind Patil
What is your current expression?
So, when it is Jan you still want to just show the last year, right? For example, in Jan 2019 you would want to see Jan-2018 - Dec-2018. But for all other months you would want to see current year and then last year. For example, in Feb 2019 you would want to see Jan-2018 - Dec - 2018 and Jan-2019 - Feb 2019? If this is true, try this
=If(Month(Today()) = 'Jan',
Count({<DeliveryYear = {$(=Year(AddYears(Today(),-1)))}>} DISTINCT DeliveryNumber),
Count({<DeliveryYear = {$(=Year(Today()))},
DeliveryMonth = {"=DeliveryMonth < Month(AddMonths(Today(),1))"}> +
<DeliveryYear = {$(=Year(Today())-1)}>} DISTINCT DeliveryNumber)
)
or simplify it to this
=RangeSum(
Count({<DeliveryYear = {$(=Year(AddYears(Today(),-1)))}>} DISTINCT DeliveryNumber), If(Month(Today()) = 'Jan', 0, Count({<DeliveryYear = {$(=Year(Today()))}, DeliveryMonth = {"=DeliveryMonth < Month(AddMonths(Today(),1))"}>} DISTINCT DeliveryNumber) ))
Oh so, by default just show current year, but with the ability to see previous year? Okay may be add a button to toggle previous year expression on and off.
Can you share a sample of what you have and I can help you better