Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MTD Table

Hi everybody,

Do you know how to do a MTD table in sript??

I have the following table and I need a NUM_SALES_MTD field

Table 1:

     NUM_SALES,

     PROVIDER_ID,

     MARKET_ID,

     DATE,

     YEAR,

     MONTH,

     WEEK ;

If I'd have only one dimension I could use peek function but I need the other dimensions...

I have tried to make the expressions at the layout but it seems to require a lot of memory...(I have a lot of expressions and the system can't support the calculation)

any Idea?

regards,

David

3 Replies
Not applicable
Author

If (YEAR= YEAR(today() and MONTH = Month(today(),NUM_SALES) as NUM_SALES_MTD

then just sum(NUM_SALES_MTD) in charts etc

its_anandrjs

Hi,

You need to create a MTD column by creating a field like

If ( Year = Year(Today()) and Monthend( today() ) , NUM_SALES)  as MTD_Sales

Regards,

Anand

Not applicable
Author

Hi,

I think you want group by here.

say :

load sum ( NUM_SALES ) as Num_Sales_MTD,

       PROVIDER_ID,

       MARKET_ID,

       DATE,

       YEAR,

       MONTH,

       WEEK

from <Your>.qvd

group by YEAR, MONTH;

HTH