Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community!
First of all excuse my bad english.
I had to do a graph that compares 2 different years, and more specifically n days at the near-end-period. Basically it looks the n days before 31/05/2024 and n days before 31/05/2023, i show it in the same graph in 2 different lines with the same scale. For exemple for the 1st of September i want to see in my graph 01 Sept in the dimension and 1000€ in blue for 2024 and 2000€ in red for 2023.
MyDate is at format DD/MM/YYYY and i am doing this :
Dimension :
Day(MyDate) & ' ' & Month(MyDate)
Measure 1 :
Sum({< MyDate = {"=MyDate>= Num(Date('$(vDateMax)','DD/MMM')) - $(vNearPeriodEnd)"} >} Amount)
Measure 2 :
Sum({<MyDate={"=MyDate<= Num(Date('31/05/23','DD MMM')) and MyDate>=Num(Date('31/05/23','DD MMM'))- $(vNearPeriodEnd)"}>}Amount)
And it works very well,
BUT i can't sort dates in the chronological order (without taking care of the year) and i tried lot of things :
Sorting by expression with "MyDate" or "Day(MyDate) & ' ' & Month(MyDate)" or Numerically or Alphabetically and i tried to create in the script "Date(NewDate,'DD MMM') as NewDate" and still doesnt work
Hope some of you have an idea.
Thanks !!
Val
@ValentinDes What did you get if you remove all the sorting option for that dimension?
@Kushal_Chawda still random sorting
Hi
Try to use dual() for sorting
dual(
Day(MyDate) & ' ' & Month(MyDate) ,
Day(MyDate) & ' ' & num(Month(MyDate))
)
Or, create a new field that is an actual data (and therefore a dual) that you use as the dimension.
Using the Date() function, you can format dates any way you want 🙂
Date([datefield], 'D MMMM') as [PrettyDateField]