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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
streetyhk
Contributor II
Contributor II

Adding a column that is a subset of data in another column

I have a table where one column is

Avg({<PeriodDateName=>}DurationOfStay)

I'd like to add another column which shows the above calculation but applied against those records where the value for Field 'WithSpecialNeeds' = 1.

What is the best way to do this.   I can create a filter where I can Choose 'WithSpecialNeeds' = 1 or 0 but ideally i"d like to see the columns next to each other so that I can see side by side the difference in stay duration when a case has special needs vs the average across all records for that selected time period.

 

Hope that makes sense!  Thank you.

Labels (2)
1 Solution

Accepted Solutions
Gabbar
Specialist
Specialist

try this:
Avg({<WithSpecialNeeds={'1'},PeriodDateName=>}DurationOfStay)

View solution in original post

2 Replies
Gabbar
Specialist
Specialist

try this:
Avg({<WithSpecialNeeds={'1'},PeriodDateName=>}DurationOfStay)

streetyhk
Contributor II
Contributor II
Author

Thank you that works perfectly.  I had tried similar but hadn't quite got the formatting correct.