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

Normalise a chart to 0-1

This is super easy to do in Python / Excel   - but given a line chart with say a time series axis,  a categorical dimension , and a range of values from negative to positive, is there an easy way to scale them?

If I have value x for example,  where x ranged from  - 1000  to  +2000   then for the normalised scale I'd have

 

x'  =      (  x - min(x) )  / ( max(x) - min(x) )

Is there a function to do this in QlikSense that I'm missing? 

Yes I can do it in load script , however it'd be more useful as a chart function as it'd work based on selection context.

 

110_0-1656335492697.png

 

 

 

 

 

Labels (1)
2 Replies
Or
MVP
MVP

Should be the same, but you might need to use aggr() to tell Qlik what the max and min values are aggregated by since it won't be aware of what your dimensions are otherwise.

e.g. Max(Aggr(Sum(Count),Date))

110
Contributor III
Contributor III
Author

I ended up doing this for a really simple example , where the X Axis is Time Series, Y Axis is Count, and the 'Line' Dimension is the 'Bin' for the individual lines.

 

 

 

(
	Sum(Count)-  Min(total <Bin>   Count)

)
/
(
	Max(total <Bin>   Count) -  Min(total <Bin>   Count)
)

 

 

 

The bottom chart in the  example does it with parameters from load script, and shows the same as the pre-calculated normalised data chart 

Up top is the original data set.      Ignore the fact Qlik is picking arbitrarily between colours for A and B 😄

It'd be cool to have it as a feature like the modifiers for cumulative sum etc as an option in Qlik.

110_1-1656933646385.png