Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Is Max_Value a variable or expression?
Maybe you just need to add a TOTAL qualifier:
Max({< Month = {"September"} >} TOTAL Timeseries)
look at the attachment
Max_Value is a variable..I will try the Total qulaifier thanks and revert
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
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:
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)