Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis with variable in bar chart

I have two variables set up:

  • vMonthHrs = Interval((Max([SchedDate])-Min([SchedDate])+1) //this gives the number of hours in each month
  • vDownTime = Interval(Sum({<QState={'Off'}>}QTime))


I then have a bar chart for the year with a dimension of MonthYear and two expressions:

  • Uptime=Interval($(vMonthHrs)-$(vDownTime))
  • Downtime=Interval($(vDownTime))

which appears to work perfectly if I select all the months.

What I need is to just select February and have it still show the bars ... so ignore the Month selection. However when I try to add set analysis ({<Month>} which is what works in all the other charts without variables) I get "No data to display".

I've clearly not quite gotten the hang of set analysis.

1 Solution

Accepted Solutions
Digvijay_Singh

You need to put ({<Month>} in all the aggregation functions, can you share your final expression?

May be like this -

  • vMonthHrs = Interval((Max({<Month>}[SchedDate])-Min({<Month>}[SchedDate])+1) //this gives the number of hours in each month
  • vDownTime = Interval(Sum({<QState={'Off'},Month>}QTime))

View solution in original post

2 Replies
Digvijay_Singh

You need to put ({<Month>} in all the aggregation functions, can you share your final expression?

May be like this -

  • vMonthHrs = Interval((Max({<Month>}[SchedDate])-Min({<Month>}[SchedDate])+1) //this gives the number of hours in each month
  • vDownTime = Interval(Sum({<QState={'Off'},Month>}QTime))
Anonymous
Not applicable
Author

Thank you. It hadn't occurred to me to put the set analysis in the variable definition.