Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

10 Rows only QlikSense

hello

I have a requirement where i need to display only the first 10 rows on a qliksense table.

i tried with Fixed Number (top 10) but as it based on a measure; If the multiple dimensions have same value. the number of rows become more than 10. 

Want to add... this table is to be used in an nprinting html report where they want only 10 rows.

in qlikview we had 'Max Number' in presentation tab. Is there an equivalent here?

@rwunderlich @sunny_talwar 

 

screenshot below to give an idea

Capture.PNG

7 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @Anonymous, maybe you can try with RowNo() function. For example: 

If(RowNo(TOTAL) <= 10, Sum([Sales Amount]))

And disabling the "Include zero values" option.

JG

Anonymous
Not applicable
Author

I tried that, unfortunately doesnt work. the number and sorting all gets messed up.

see below screenshot and compare to one before in my original post. you can see that 'Order Count' = 1s have disappeared because the order gets messed up. Same result if i put a measure rowno(total) and try to get top 10 from there. 

Capture.PNG

 

Kushal_Chawda

@JuanGerardo  may be below

1) Create composite key for dimensions used in table. Based on screenshot I have assumed there are two dimension. You can create Key accordingly if there are others dimensions

LOAD *,

         autonumberhash256( CategoryName&CustomerCountry) as Key 

FROM table;

2) Use below measure in your table

    =if (aggr( RowNo(total), (Key,(=sum(Sales),ASCENDING)))<=10 ,sum(Sales))

Replace sum(Sales) with your actual expression

3) Go to Add-ons , uncheck Include zero values option

4) Go to Sorting, promote measure to top with Numeric ascending option

Anonymous
Not applicable
Author

HI Kushal

the actual scenario is much more complicated. the screenshot is from just a sample app.

actual app has around 10 dimensions.

If there is no simple way to do that seems to be a big feature gap in sense

Kushal_Chawda

If you have 10 dimensions then you need to create composite key using 10 dimension in script and use it in expression as I mentioned.

Anonymous
Not applicable
Author

unfortunately i cant create that kind of composite; that wont work as its not a flat data model it s star schema and the columns are in different tables.

Kushal_Chawda

@Anonymous  If you are using star schema then also you can do it with IDs in Fact table. Your dimension tables might be linked to Fact table with Ids within Fact table. So you can make composite key using IDs. For eg.  category name ID, Country ID, etc.