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

Set analysis, ensure one record is always displayed regardless of user selection

Hi,

I have a line graph with multiple lines being displayed. the dimensions that each line represents is the UserID. I have a specific UserID (-1) which I want to display regardless of the users selection.

So for example if there were 100 users and therefore 100 lines on the graph. If a user selects UserID's 1 to 50 I want it still to display the UserID -1. I realise this should be achieved with set analysis but am unable to achieve it.

The expression that I am currently using is:

IF(ProcessKey<>'0-1',

If(PositionEvent.Position='Middle' and Gender='Male',(EventTime),

If(PositionEvent.Position='Middle' and Gender='Female',(EventTime)*-1,

If(Gender='Male',0.001,-0.001))))

I believe I might need to use the MAX function to wrap the set analysis around?

So my aim is that the graph should show only the selected UserIDs based on the user's filters except regardless of the user's selection the UserID of -1 will be displayed.

Any assistance would be greatly appreciated.

14 Replies
Nicole-Smith

You missed the 1 in the set analysis to ignore other fields:

MAX({1<PatientID = PatientID+{'RefA', 'RefB'}, ProcessStage=P(ProcessStage), ProcessStage2=P(ProcessStage2)>}

IF(PatientID='RefB' AND PositionProcess.Position='Middle', (TimeBetweenEvents),

IF(ProcessKey<>'0-1',

IF(PositionProcess.Position='Middle' and Gender='Male',(TimeBetweenEvents),

If(PositionProcess.Position='Middle' and Gender='Female',(TimeBetweenEvents),

IF(Gender='Male',0.0001,0.0001))))))

Not applicable
Author

This still doesn't seem to do what I am after. With the updated expression I am getting the following results:

- with no filters all lines appear

- If I make a selection based on ProcessStage or ProcessStage2 it works as I would like (all lines appear for that section of the graph

- If I make a selection on PatientId it still shows all the line for every patient, when I want it to just show the selected patients and RefA/RefB lines

- The same thing appears to happen for all other fields e.g. if I chose a specific County I still have all the lines shown on the graph for all the patients not just those within that county and RefA/RefB lines.

The expression I am using is:

MAX({1<PatientID = PatientID+{'RefA', 'RefB'},ProcessStage=P(ProcessStage), ProcessStage2=P(ProcessStage2)>}

IF(PatientID='RefB' AND PositionProcess.Position='Middle', (TimeBetweenEvents),

IF(ProcessKey<>'0-1',

IF(PositionProcess.Position='Middle' and Gender='Male',(TimeBetweenEvents),

If(PositionProcess.Position='Middle' and Gender='Female',(TimeBetweenEvents),

IF(Gender='Male',0.0001,0.0001))))))

(I realise there are some unnecesssary IFs but I have kept them in incase in the future I want to split how Male and Female patients are displayed.

Any help would be greatly appreciated.

Thanks


Dan

Nicole-Smith

Can you post a .qvw with your graph?  It's almost impossible to figure out what is wrong without the actual file.  If you have confidential data, see Preparing examples for Upload - Reduction and Data Scrambling

Not applicable
Author

Hi Nicole,

Please see the attached QVW file.

The aim is that the reference line (which always has a patient ID of either 'RefA' or 'RefB' within the data should always show up but that the user should be able to make dynamic selections on all the other patients.

Currently the following works:

- If a single Kykdomsgruppe (Illness Group) is selected and no other selections are made

- If you also apply filters on the 'Start Prosess' value or 'End Prosess' value (it is assumed that the target route is linear e.g. 1 to 2 to 3 etc. So if you make a selection of 'Start Process' 3 and 'End Prosess' 6 it is okay that no reference line displays.

What doesn't work:

- If you make any selection on other filters for example 'Aldersgruppe' (age group) or 'Fylke' (location area) or 'Ansvarlig lege'  (lead practitioner), PatientID etc.

I hope I have been clear enough but if you do have any clarifications please do let me know. Thank you for your help.

Nicole-Smith

I think I may have it (see the attached).

What I did:

1.  Changed your expression a bit

2.  Created a variable to use in your second dimension

3.  Changed your second dimension

What you will still need to do:

1.  Change background color on expression

2.  Change line style on expression

Hopefully this works for you!