# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for
Did you mean:
Not applicable

## Range count distinct

Hi!

Is it possible to make range count for distinct values (like RangeSum)?

 Date Uniq Users Uniq users for 3 day Day 1 148 148 Day 2 177 318 Day 3 199 501 Day 4 177 521 Day 5 162 510 Day 6 164 463 Day 7 149 448 ... ... ...

I have fields:

- Date

- count(distinct Users) as Uniq Users

I need:

- unique users in range day 1 - day 3 , day 2 - day 4 ...

1 Solution

Accepted Solutions
MVP

maybe a script solution could be

x1:

date, user

1,a

1,b

1,c

1,d

2,a

2,b

2,b

2,c

3,b

3,b

3,c

4,d

5,a

5,b

5,c

5,d

5,e

];

x2:

date as date2,

date + iterno() -1 as date

Resident x1

While iterno() <= 3;

make a chart with

dimension     date2

expression     count(distinct if(date=date2, user))

count(distinct user)

5 Replies
MVP

RangeSum(Above(Count(DISTINCT Users), 0, 3))

Not applicable
Author

Yes, I did.

It's a sum of all values in range  , not unique ones. =(

I mean :

Count (distinct Users)_Day1 + Count(distinct Users)_Day2 + Count(distinct Users)_Day3

not equal

Count (distinct Users)_Day1-3

MVP

Right, but you are using doing a rangesum right?

MVP

maybe a script solution could be

x1:

date, user

1,a

1,b

1,c

1,d

2,a

2,b

2,b

2,c

3,b

3,b

3,c

4,d

5,a

5,b

5,c

5,d

5,e

];

x2:

date as date2,

date + iterno() -1 as date

Resident x1

While iterno() <= 3;

make a chart with

dimension     date2

expression     count(distinct if(date=date2, user))

count(distinct user)

Not applicable
Author

date + iterno() -1  shows next 3 dates.

I change it to date - iterno() +1 and it works!

Thanks!