Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top N Customers - Number Series with Step

Hello There!

I've created Top N Customers' Sales Chart based on an Input box of any number (say, 5, 10, 15 etc.). Now, I need to change it like a way that where I can input any number (say 50); then Top 50 Customers Data will be shown. Then with a Click to 'Next' Arrow, next Top 50 Customers' Data should be displayed.... and so on... Actually I want to have mechanism like the snap-shots given below:-

1-50 List.png     51-100 List.png

Can anyone suggest me how can I achieve that easily?

Thanks in Advance.

Sajjad.

15 Replies
Not applicable
Author

Dear Mr. Peter,

Thanks for the attachment (qvw) and I hope this will help. It's neat & crispy as I gone through it quickly!

Appreciate your effort a lot!

Regards,

- Sajjad.

Not applicable
Author

Dear Mr. Michael,

Thanks for your qvw attachment for the solution.... however, while opening the qvw, it is asking for to recover the file. [screen-shot attached below]

asking recover file.png

Would appreciate if you suggest me further.

Thanks again,

- Sajjad.

Anonymous
Not applicable
Author

I doubt it was created in a personal edition, but it was long ago, can't be sure.  I just re-saved it in a licensed QV version, and re-attached into the same message.  Try again.

If it doesn't help...  I don't know.  You need license for your QV to open the file.  Worst, case, if nothing works, I'll describe the script and the front object's properties.

Not applicable
Author

Dear Mr. Michael,


Thanks a lot for your effort.... but it didn't work.... same massage appearing .... asking for recovery...


Thanks again for your help.


- Sajjad.

Anonymous
Not applicable
Author

OK, I'll describe in words then.

Here is the whole of this example:

Data:
LOAD
RowNo() as ID,
right(floor((rand()*100000)),2) as X,
money(rand()*1000) as Amount
AUTOGENERATE 1000;
 
// Assuming it must be sorted by X, then by ID
LEFT JOIN (Data) LOAD DISTINCT
ID,
X,
RowNo() as TableSortOrder
RESIDENT Data
ORDER BY X, ID;

The font end.

There are two variables:

- vPage (it shows the current page)

- vPageSize

There is an input box for vPageSize

    

There is a text box

The "text" there is an expression

='Page ' & vPage & ' of ' & ceil(count(distinct TableSortOrder)/vPageSize)

And, there are four buttons overlaying the text box, all use action set variable vPage, but with the different value.  Button text in bold here:

|<< (go to the beginning) , sets value to 1

>  sets value to =vPage+1  This button is enabled on condition

vPage<ceil(count(distinct TableSortOrder)/vPageSize)

< sets value to =vPage-1;  it is enabled on condition vPage>1

>>| (go to the end) sets value to =ceil(count(distinct TableSortOrder)/vPageSize)

The last is the table itself.  It is a straight table, first dimension is calculated

=aggr(if(rowno(total)>=(vPage-1)*vPageSize+1 and rowno(total)<=vPage*vPageSize,TableSortOrder), TableSortOrder)

As always with calculated dimension - check "suppress when value is null".  The label of this dimension is "Order"

The other two dimensions are X and ID.

Expression is sum(Amount)

Hope I didn't miss anything essential.

Not applicable
Author

Dear Mr. Michael,


Though I've not yet worked out your solution but seeing at your details Step-by-Step narration, it's really amazed me and can't stop leaving a note for you first. I must appreciate it and a big THANK YOU to you!


I hope this will work and Thanks again for your help.


- Sajjad.