5 Replies Latest reply: Dec 31, 2012 2:34 AM by Jonathan Brough

# 30 day count(distinct) every day

Tried to build a chart, where every day is how many unduplicated users visited in 30 days including this one.

For example on January 30 = count({date={">=01/01/2012 <=30/01/2012"}}distinct user_id)

It works for 1 day, but i need chart.

Can someone give solution?

• ###### Re: 30 day count(distinct) every day

Jonathan

• ###### Re: 30 day count(distinct) every day

cycle dimention day(date) and day(date)&month(date)

• ###### Re: 30 day count(distinct) every day

The set analysis needs to be surrounded by <> brackets. You'll also need to use dynamic dates. Try ...

count({<TransDate={'>=\$(=Today()-30) <=\$(=Today())'}>} distinct user_id)

Jonathan

• ###### Re: 30 day count(distinct) every day

Hi,

Rangesum and above functions may help. Pls. have a look at the attached example.

Regards,

• ###### Re: 30 day count(distinct) every day

Actually, I see now that you mean you want roling 30 day results, with the data point for each date being for the 30 days previous to that date.

See this post on Rolling 12 months (http://community.qlik.com/thread/38355). You should be able to apply the same logic to the last 30 days.

Jonathan