Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
avner_raz
Contributor III
Contributor III

Greater then today's Year-Month

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

5 Replies
marcarreras
Specialist
Specialist

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.

avner_raz
Contributor III
Contributor III
Author

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

marcarreras
Specialist
Specialist

Avner,

Actually you will get the same result, because Monthname function returns the same numeric value than Monthstart function.

Marc.

avner_raz
Contributor III
Contributor III
Author

That's right,

but I was afraid to lose the connection between the month and the year.

marcarreras
Specialist
Specialist

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.