Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Load *;
Sql select
* from dm.db
Where monthstart([YourMonthYear]) >= monthstart(addmonths(today(),-12));
Is there any equivalent function function for addmonths in sql ?
It depends on the SQL dialect that your database is using. The SQL statement in Qlik sends everything after the SQL and before the semicolon to the database driver that you are using and it is up to the SQL database and driver to interpret it and return some results.
For Microsoft SQL Server you can use the DATEADD( month , 1 , SalesDate ) as an example.
For Oracle you can use ADD_MONTHS( SalesDate , 1 ) as another example.
So you will have to look at the documentation for your particular SQL database.
It depends on the SQL dialect that your database is using. The SQL statement in Qlik sends everything after the SQL and before the semicolon to the database driver that you are using and it is up to the SQL database and driver to interpret it and return some results.
For Microsoft SQL Server you can use the DATEADD( month , 1 , SalesDate ) as an example.
For Oracle you can use ADD_MONTHS( SalesDate , 1 ) as another example.
So you will have to look at the documentation for your particular SQL database.
Thank you sir.