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: 
Not applicable

Normalising Data

I am trying to normalize a time series relative to say the peak value of the stream, or even to the first value :

I have say a time series of values , with their day number and their month ( 92 days over 3 months  ie august to October). I tried to use set analysis to fix say the peak value in September. ie Max_Value = Max({< Month = {"September"} >} Timeseries). I then tried to use a bar graph where the expression is Timeseries / Max_Value. This gives a series of ones ie the expression keeps normalizing the values over the value itself ..it does not keep the Max value according to the September Maximum.  How do you therefore Normalize the stream over a desired value ie a preferred Month's maximum value. I am probably using misusing set analysis here?


Thanks

G.

6 Replies
swuehl
MVP
MVP

Is Max_Value a variable or expression?

Maybe you just need to add a TOTAL qualifier:

Max({< Month = {"September"} >} TOTAL Timeseries)

maxgro
MVP
MVP

look at the attachment

Not applicable
Author

Max_Value is a variable..I will try the Total qulaifier thanks and revert

Not applicable
Author

Can you send it in qliksense file  as I cant open it as i only have  a personal edition qlikview., .or send an image .

I am using qliksense in this application but am fully conversant in qlikview as well

Thanks

Graham

swuehl
MVP
MVP

You can also try adding an equal sign to your variable definition, so that it evaluates in global scope before the variable expansion in the chart expression happens:

The Magic of Variables

maxgro
MVP
MVP

SCRIPT

SET MonthNames='jan;feb;mar;apr;may;jun;jul;aug;sep;oct;nov;dec';

SET DateFormat='DD/MM/YYYY';

d:

load

  *,

  Month(date) as month,

  year(date) as year;

load

  date(makedate(2015, 😎 + ceil(rand()*92)) as date,

  ceil(rand()*100) as timeseries

AutoGenerate 100;

CHART (straight table)

dimension    date

expression    sum(timeseries) / $(=max({$ <month={sep}>} timeseries))          // yellow col

or another one

expression   sum(timeseries) / max(total {$ <month={sep}>} timeseries)        // green col

other expression (white column), just for test

sum(timeseries)

max(timeseries)

$(=max({$ <month={sep}>} timeseries))

max(total {$ <month={sep}>} timeseries)

1.png