Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I have a problem for counting records lower of a data of last year.
I have try:
count({$<[Mydata.autoCalendar.Date]={"<Data1ago"}>} [Sales])
but don't work.
where Data1ago is a variable so defined =Date(AddYears(Today(), -1))
Could anyone help me? Thank you
Hi Gabriele,
The problem is that your variable isn't executed, try this:
count({$<[Mydata.autoCalendar.Date]={"<$(Data1ago)"}>} [Sales])
Besides this, you can expect some problems with your date format when it's not correct. The best thing to do would be to floor all your dates.
// Add this in your script
Floor([Mydata.autoCalendar.Date]) as [Mydata.autoCalendar.Date]
// and floor your variable
Date1ago = Floor(Date(AddYears(Today(), -1)))
Jordy
Climber
Hi Gabriele,
The problem is that your variable isn't executed, try this:
count({$<[Mydata.autoCalendar.Date]={"<$(Data1ago)"}>} [Sales])
Besides this, you can expect some problems with your date format when it's not correct. The best thing to do would be to floor all your dates.
// Add this in your script
Floor([Mydata.autoCalendar.Date]) as [Mydata.autoCalendar.Date]
// and floor your variable
Date1ago = Floor(Date(AddYears(Today(), -1)))
Jordy
Climber