Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik Community,
I am trying to display a value for each record that my query brings back based on what third of the overall distinct record count being displayed is. For example, if I have 9 records being displayed, I want a column to display text values based on what 1/3rd of records it is in.
As shown in the table below, this is my desired outcome, based on how many rows are being displayed, I'd like some calculations to essentially group the rows into thirds, so I can display a value using an IF statement based on what third the row is bucketed into.
Order Number | Record/RowNumber | Third | Value |
100641 | 1 | 1st Third | Value 1 |
25002 | 2 | 1st Third | Value 1 |
106503 |
3 | 1st Third | Value 1 |
100431 | 4 | 2nd Third | Value 2 |
6845 | 5 | 2nd Third | Value 2 |
35454 | 6 | 2nd Third | Value 2 |
818281 | 7 | 3rd Third | Value 3 |
65771 | 8 | 3rd Third | Value 3 |
9846 | 9 | 3rd Third | Value 3 |
I hope this makes sense. Any assistance would be appreciated!
ceil(rowno(total) / (ceil(noofrows(total)/3)))