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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Saravanan024
Contributor II
Contributor II

Set Analysis support required

I need a trend line on a line graph for EVERY year with the analysis condition listed below. I'm just receiving output for a single year right now, so I'm wondering whether there's any way to change it such that several trend lines for prior years are displayed.

Aggr(RangeSum(Above(TOTAL (sum( {$<Year={$(=max(Year)-1)}>} Quantity_Consumed ))

/

Sum({$<[TICSA],Year={$(=max(Year)-1)}>} TICSA)

  *

 (

RangeAvg(Above(Count({$<Year={$(=max(Year))}>} Equipment), 0, RowNo())))

 , 0, RowNo(TOTAL))),Month)

Labels (2)
1 Solution

Accepted Solutions
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Saravanan024 

Depening on the number of years you want to see I would just change the set Analysis to (This should show 4 years) But for this to work you need Year as a Dimension. 

Aggr(RangeSum(Above(TOTAL (sum( {$<Year={"<=$(=max(Year)-4)"}>} Quantity_Consumed ))

/

Sum({$<[TICSA],Year={"<=$(=max(Year)-4)"}>} TICSA)

  *

 (

RangeAvg(Above(Count({$<Year={$(=max(Year))}>} Equipment), 0, RowNo())))

 , 0, RowNo(TOTAL))),Month)

Alternatively you can add multiple measures for "each" year. (Just change these parts in the set analysis) 

So change the Max(Year)-1 (Prev year) 

So change the Max(Year)-2 (2 Years ago) 

So change the Max(Year)-3 (3 Years ago)

Regards Jandre

 

 

 

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

View solution in original post

1 Reply
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Saravanan024 

Depening on the number of years you want to see I would just change the set Analysis to (This should show 4 years) But for this to work you need Year as a Dimension. 

Aggr(RangeSum(Above(TOTAL (sum( {$<Year={"<=$(=max(Year)-4)"}>} Quantity_Consumed ))

/

Sum({$<[TICSA],Year={"<=$(=max(Year)-4)"}>} TICSA)

  *

 (

RangeAvg(Above(Count({$<Year={$(=max(Year))}>} Equipment), 0, RowNo())))

 , 0, RowNo(TOTAL))),Month)

Alternatively you can add multiple measures for "each" year. (Just change these parts in the set analysis) 

So change the Max(Year)-1 (Prev year) 

So change the Max(Year)-2 (2 Years ago) 

So change the Max(Year)-3 (3 Years ago)

Regards Jandre

 

 

 

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn