Re: Need help to create a query in expression level
Generaly you could perform these calculations within a gui-expression. If there are enough selections or there aren't thousands of rows in table-charts the performance could be sufficient. You should simply try it.
Within the script you could use an incremental logic - Incremental Load - or create extra tables with the count(month) and so on which are linked by a keyfield or used per mapping and applymap().
But you should also have a look on your RAM (taskmanager) and your working sets properties then if qlik used the virtual RAM it would be very slow. Also to avoid a resident load and load from a qvd could improve the performance.