Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have an expression where i want to present future months.
this table is brings seasonal Data ( sep-2014 to sep-2015).
I'm trying to find a way to calculate values only if their Year-Month is equal or greater then today's year month.
appreciate any help
Avner
Hi,
Best solution is to create a flag in script and then use it in the experssion.
In scrip->>
LOAD *, if(monthname(today())>=yourmonthnamefield, 1,0) as FlagFuture;
LOAD*, monthname(yourdatefield) as yourmonthnamefield
FROM yoursource;
In expression->>
=sum({<FlagFuture={'1'}>} yourvaluefield)
Hope it helps.
Marc.
Hi Marc
thanks for your help, i used your syntax but added MonthStart, because i need the full date format.
if(Date>=MonthStart(today()),1,0) as Future_Flag
cheers
avner
Avner,
Actually you will get the same result, because Monthname function returns the same numeric value than Monthstart function.
Marc.
That's right,
but I was afraid to lose the connection between the month and the year.
Avner,
You will only loose the connection between year and month with the Month() function, that returns only the month and not the year.
Use Monthname or Monthstart as your election, the difference is the format of result date, but not the internal numeric value.
Marc.