Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

determine trends across multiple rows

Here's my sample data...

Load * Inline [ 

Exercise, ID, Result

Exercise 1, ABCD, selected

Exercise 1, QRST, selected

Exercise 1, LMNO, selected

Exercise 2, ABCD, no selection

Exercise 2, QRST, selected

Exercise 2, LMNO, selected

Exercise 3, ABCD, selected

Exercise 3, QRST, no selection

Exercise 3, LMNO, selected

];

I need to be able to show trends by ID.  Additionally I want each 'no selection' to reset the counter.

For example the required results would be…

ABCD 1 selected

QRST 0 selected

LMNO 3 selected

Is this doable?

Thanks.

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi Scott,

see Attachment.

Regards,

Antonio.

View solution in original post

9 Replies
Anil_Babu_Samineni

How you are calculating the result set? Will you able to explain little more

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

At this point I was thinking of a simple chart...

IDExercise 1Exercise 2Exercise 3Trend
ABCDselectedno selectionselected1 selected
QRSTselectedselectedno selection0 selected
LMNOselectedselectedselected3 selected
antoniotiman
Master III
Master III

Hi Scott,

see Attachment.

Regards,

Antonio.

effinty2112
Master
Master

Hi Scott,

This script:

TableA:

Load

Exercise,

ID,

if (Result = 'selected',Dual('selected',1),Dual('no selection',0)) as Result;

Load * Inline [

Exercise, ID, Result

Exercise 1, ABCD, selected

Exercise 1, QRST, selected

Exercise 1, LMNO, selected

Exercise 2, ABCD, no selection

Exercise 2, QRST, selected

Exercise 2, LMNO, selected

Exercise 3, ABCD, selected

Exercise 3, QRST, no selection

Exercise 3, LMNO, selected

];

NoConcatenate

TableB: LOAD * Resident TableA Order by ID,Exercise;

Drop Table TableA;

NoConcatenate

TableC:

LOAD

Exercise, ID, Result,

AutoNumber(Exercise,ID) as ExID,

if(ID=Peek(ID),Result*rangesum(Result, num(Peek(AccResult))),Result) as AccResult

Resident TableB;

Drop Table TableB;

will allow you to create this table:

ID FirstSortedValue(Num(AccResult),-ExID)
ABCD1
LMNO3
QRST0

Cheers

Andrew

Not applicable
Author

That's perfect.  Exactly what I was looking for.  One more addition that would be nice... is there a way to allow a user to select on the totals?  Given the results above, if I had a selection for the user and they selected '3', they would get the result set filtered down to just LMNO.  If they selected '1', they would get ABCD.  Possible?

antoniotiman
Master III
Master III

Yes, if I click in TOTAL 3 then

Not applicable
Author

Super Antonio!  One last question.  If I wanted to eventually change to count the total number of 'selected' for an ID, would I be able to keep the basic logic and just tweak it for that?

antoniotiman
Master III
Master III

Yes, You ca.

Regards,

Antonio

Not applicable
Author

Thanks Antonio.  How much would the load change if they went that direction?