Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
my Expression looks like this :
avg({<PurchaseDate<=2015-01-15>}Sales
as you can see I have a Date column (PurchaseDate) and a simple date 2015-01-15
in sql i would simply :
PurchaseDate <= convert(datetime,'2015-01-15',suitable Style)
thanks in advance
Try with
Avg({<PurchaseDate = {'<=2015-01-15'} >} Sales )
You can use it dynamically also
Regards
Anand
set vCompareDate=Date('2015-01-15','YYYY-MM-DD')
avg({<PurchaseDate={"<=$(vCompareDate)"}>}Sales
Make sure both the dates are in same format
Your set analysis syntax is incorrect. Please try below expression
avg({<PurchaseDate = {'<=2015-01-15'}>}Sales)
Regards,
Greeshma
Hi,
if you want to compare a field value with a specific date or variable then use code like this
set vCompareDate=Date('2015-01-15','YYYY-MM-DD')
avg({<PurchaseDate={"<=$(vCompareDate)"}>}Sale)
----------------------------------
if you are facing problem then covert the date into number format then use (num(PurchaseDate)).
set vCompareDate=num(Date('2015-01-15','YYYY-MM-DD'))
avg({<PurchaseDate={"<=$(vCompareDate)"}>}Sales)
Regards
Vimlesh
the above expression does not work, i don't know why.
but, what if i try this?
avg({<Year(PurchaseDate)<2015,Month(PurchaseDate)<1>}Sales)
it is like in sql i try:
where
datepart(year,PurchaseDate)<2015 and DatePart(Month,PurchaseDate)<1