Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Keerthi1234
Contributor III
Contributor III

Segregate rows into batches using Ceil(RowNo(TOTAL) / 5

Hi,

I am working on a table where I need to separate 24 records(rows) into a batch so for that I used Ceil(RowNo(TOTAL) / 5) & ' batch' , if the table has 24 rows it segregated it into 1 batch, 2 batch till 5 batch,

Now I need to replace the 5 batch as 'last batch', I tried using If(Ceil(RowNo(TOTAL) / 5) = Max(Ceil(RowNo(TOTAL) / 5)), 'Last Batch', 'Batch ' & Ceil(RowNo(TOTAL) / 5)),But still it gives the same 1 to 5 batches .

I tried storing them in different variables and tried it's still the same, what can be done here to add the final batch  label as last batch. I need it to be a part of chart expression and not in script.

Keerthi1234_0-1746515758547.png

Here Batch 5(which is the final batch) must be replaced as last Batch

Can someone help with this

Thanks,

Keer

2 Replies
SRA
Partner - Creator
Partner - Creator

Hi,

I imagine you have some dimensions in your table. Correct ?

If yes, you can count the number of batches by counting the dimension :

If(Ceil(RowNo(TOTAL) / 5) = Ceil(Count(TOTAL YourDimension) / 5), 'Last Batch', 'Batch ' & Ceil(RowNo(TOTAL) / 5))

SRA_0-1746547658476.png

Regards,

SRA

Keerthi1234
Contributor III
Contributor III
Author

Hi SRA,

Thanks for your response!

This is not working in my case, yes as you mentioned I have dimensions in my table as 'product name' and 'product number', both doesn't give the label 'last batch'.

Can you help me here?

Thanks,

Keer