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

Occurrences appear (COUNTIF ? by subgroup as in excel)

Hello,

I want to do exact same calculation as I have in excel.

It is running number of occurrence of SN. In every case it should chceck all above and return number of repeat.

Is there any option to do this in Chart/Script?

SN FX OCC
1000005 =COUNTIF(A$2:A2;A2) 1
1000005 =COUNTIF(A$2:A3;A3) 2
1000036 =COUNTIF(A$2:A4;A4) 1
1000037 =COUNTIF(A$2:A5;A5) 1
1000046 =COUNTIF(A$2:A6;A6) 1
1000072 =COUNTIF(A$2:A7;A7) 1
1000130 =COUNTIF(A$2:A8;A8) 1
1000145 =COUNTIF(A$2:A9;A9) 1
1000169 =COUNTIF(A$2:A10;A10) 1
1000169 =COUNTIF(A$2:A11;A11) 2
1000179 =COUNTIF(A$2:A12;A12) 1
1000005 =COUNTIF(A$2:A13;A13) 3
1000179 =COUNTIF(A$2:A14;A14) 2
1000179 =COUNTIF(A$2:A15;A15) 3
1000179 =COUNTIF(A$2:A16;A16) 4
Labels (3)
1 Solution

Accepted Solutions
SerhanKaraer
Creator III
Creator III

Hello MT4T,

You can do it easily in script.

AutoNumber's second parameter acts as partitioning records.

Fact:
LOAD SN, AutoNumber(Recno(), SN) as OCC INLINE [
SN
1000005
1000005
1000036
1000037
1000046
1000072
1000130
1000145
1000169
1000169
1000179
1000005
1000179
1000179
1000179
];

 

View solution in original post

1 Reply
SerhanKaraer
Creator III
Creator III

Hello MT4T,

You can do it easily in script.

AutoNumber's second parameter acts as partitioning records.

Fact:
LOAD SN, AutoNumber(Recno(), SN) as OCC INLINE [
SN
1000005
1000005
1000036
1000037
1000046
1000072
1000130
1000145
1000169
1000169
1000179
1000005
1000179
1000179
1000179
];