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

Two not connected time periods in one set analysis command

Dear community,

I would like to compute one single standard deviation for the data of two time periods which are not directly connected. I'm using variables to define the minimum and maximum dates of the two ranges.

To make up an example let's assume that


vMinDtControlPeriod1 = 1.1.2017

vMaxDtControlPeriod1 = 10.1.2017

vMinDtControlPeriod2 = 20.1.2017

vMaxDtControlPeriod2 = 25.1.2017

To compute the standard deviation of one single date range the simple set analysis command would look like this:

Stdev(Aggr(count({$< bkg_dt={">=$(vMinDtControlPeriod1)<=$(vMaxDtControlPeriod1)"}>} counter), bkg_dt))

But I cannot find a way to include the second time range as well. I tried something like

Stdev(Aggr(count({$< bkg_dt={">=$(vMinDtControlPeriod1)<=$(vMaxDtControlPeriod1)"},

                                    bkg_dt={">=$(vMinDtControlPeriod2)<=$(vMaxDtControlPeriod2)"}>} counter), bkg_dt))


but this is not working. Is there any way to filter the data on two not directly connected periods using an "or" command or anything else?


Thanks in advance,

Chris

1 Solution

Accepted Solutions
sunny_talwar

May be this

Stdev(Aggr(Count({$< bkg_dt = {">=$(vMinDtControlPeriod1)<=$(vMaxDtControlPeriod1)"}>+<bkg_dt = {">=$(vMinDtControlPeriod2)<=$(vMaxDtControlPeriod2)"}>} counter), bkg_dt))

View solution in original post

3 Replies
sunny_talwar

May be this

Stdev(Aggr(Count({$< bkg_dt = {">=$(vMinDtControlPeriod1)<=$(vMaxDtControlPeriod1)"}>+<bkg_dt = {">=$(vMinDtControlPeriod2)<=$(vMaxDtControlPeriod2)"}>} counter), bkg_dt))

sunny_talwar

Or even this

Stdev(Aggr(Count({$< bkg_dt = {">=$(vMinDtControlPeriod1)<=$(vMaxDtControlPeriod1)", ">=$(vMinDtControlPeriod2)<=$(vMaxDtControlPeriod2)"}>} counter), bkg_dt))

chrizviz
Contributor
Contributor
Author

Thanks! Problem solved!