Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Inter-record count

Hello,

I have a question for a scenario I cannot solve.

I would like to count how many times a record from table 1 went back from status 3 to status 2.

In case of item A for example, this is 3 times.

In case of item B for example, this is 2 times.

Thx in advance for any help!

Table 1Table 2 - DateTable 2 - Status
A1Status 1
A2Status 2
A3Status 3
A4Status 2
A4Status 2
A5Status 3
A7Status 2
A8Status 3
A9Status 4
B1Status 1
B2Status 2
B3Status 3
B4Status 2
B5Status 2
B6Status 2
B7Status 2
B8Status 3
B9Status 4
1 Solution

Accepted Solutions
maxgro
MVP
MVP

str table chart with expression

len(keepchar(replace('-' & concat([Table 2 - Status], '-', [Table 2 - Date]) & '-', 'Status 2-Status 3-', '@'), '@'))

1.png

script

t:

LOAD [Table 1], [Table 2 - Date], [Table 2 - Status]

FROM [http://community.qlik.com/thread/128701] (html, codepage is 1252, embedded labels, table is @1);

View solution in original post

3 Replies
maxgro
MVP
MVP

str table chart with expression

len(keepchar(replace('-' & concat([Table 2 - Status], '-', [Table 2 - Date]) & '-', 'Status 2-Status 3-', '@'), '@'))

1.png

script

t:

LOAD [Table 1], [Table 2 - Date], [Table 2 - Status]

FROM [http://community.qlik.com/thread/128701] (html, codepage is 1252, embedded labels, table is @1);

Not applicable
Author

Inspiration sometimes comes at the end of the workingday.

I just found out that the Above() function can be used to compare two records.

So far, so good. Now just counting them.

I will try out your solution as well Massimo.

Thanks a lot already for the reaction!

Not applicable
Author

Thank you Massimo.

Nice approach to my problem! Will remember that for the future.