Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative count for chart

Hi, I have a question about count a dimension.

Here is the sample :

IDDate
A1-Jan
B1-Jan
C1-Jan
B2-Jan
C2-Jan
C2-Jan
D2-Jan
C3-Jan
E3-Jan

There are 5 IDs : A,B,C,D,E

I want to make chart that show :

1 Jan has 3 IDs ( That 3 IDs from count distinct 1 Jan : A, B C)

2 Jan has 4 IDs ( That 4 IDs from count distinct 1 Jan to 2 Jan : A, B C,D)

3 Jan has 5 IDs ( That 5 IDs from count distinct 1 Jan to 3 Jan : A, B C,D,E)

Does someone has any idea what kind of expression I could use for this case?

Thanks.

13 Replies
Not applicable
Author

no...

in script:

DATE:

LOAD Distinct Data as CALENDAR Resident TABLE Order BY Data;

FOR i = 1 to NoOfFields('DATE')

LET D = Peek('DATE',$(i),'Data');

load ID as ID1, Data Resident TABLE WHERE NOT Exists(ID1,ID);

NEXT i

Not applicable
Author

if we use full accumulation, it will give us

1 jan has 3 IDs

2 jan has 6 IDs

3 jan has 8 IDs

Not applicable
Author

DATE is a table:

DATE:

LOAD Distinct Data as CALENDAR Resident TABLE Order BY Data;

maxgro
MVP
MVP

Credo funzioni anche con altri ID nel modello

I possibili problemi potrebbero essere che la Date2 isola non sente le selezioni sulla Date (a meno di .....), che l'espressione con l'if è più "pesante" nei calcoli.

Altra soluzione potrebbe essere forse l'AsOf, si trova sul forum

Ora guardo il tuo metodo.

Sì è una di quelle cose che periodicamente tornano e che dovrebbero essere banali ma in Qv non tanto.