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

Touble with AddMonth in set analysis

hye all,

I'm in trouble using addmonth in a set analysis.

In Load :

Load  Date(Date#(DAT_CONSO_COJ,'YYYYMMDD'),'DD/MM/YYYY') as DAT_CONSO_CONS_NEW,

DAT_CONSO_COJ,

        IDF,

        Code;

BASE_TEST:

LOAD *  INLINE [

DAT_CONSO_COJ, IDF, Code

20180502,1,A

20180502,11,A

20180503,2,A

20180503,12,A

20180504,3,A

20180505,4,J

20180601,1,A

20180601,21,A

20180601,11,A

20180602,2,A

20180603,3,A

20180604,5,A

20170502,1,J

20170503,2,A

20170505,3,A

20170505,13,A

20170506,6,A

20170501,1,J

20170602,2,A

20170603,3,A

20170604,4,A


];




Set Vdim = DAT_CONSO_CONS_NEW;

Set VAnneePrec = AddMonths($(Vdim),-12);



When I try to use Count({$<DAT_CONSO_CONS_NEW = {"=$(VAnneePrec)"}>}IDF)  the result is the same than te current year.

Exemple attached (select from 02/05/2018 to 05/05/2018 for exemple)

Thanks.

1 Solution

Accepted Solutions
sunny_talwar

2 Replies
sunny_talwar

Try using The As-Of Table

Anonymous
Not applicable
Author

Thanks.

I'll try to do something right with that. It's not so easy as i coul magine 😉

I''l post the result if it's correct.

Edit : i post it.