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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Last Records

Hi All

I am needing help with the following

I want to display the last 4

A1

A2

A3

A4

A5

A6

Etc

So if I select A6 I see A3, A4, A5, A6

If I am at A50 I see A47, A48, A49, A50 etc

In script

Any ideas how to achieve this?

SK

4 Replies
vamsee
Specialist
Specialist

Try

     AddMonths(Floor(MonthEnd(Today())),-12)

or

     AddMonths(Floor(MonthEnd(Max(Date_Field))),-12)

and then achieve Quarters from that date

Anonymous
Not applicable
Author

I Don't Know What exactly you mean here

Lets make it simple

I have records

1

2

3

4

5

When I get to 5 I want to show 2, 3, 4,5

When I am at 40 I want 36,37,38,39

Whatever record I am showing I want to show only the last 4 records, I hope this makes sense

Thanks

sergio0592
Specialist III
Specialist III

You can just make :

    Floor(MonthEnd(Today(),-12))

or

   Floor(MonthEnd(Max(Date_Field),-12))

vamsee
Specialist
Specialist

I didn't quite understand your example, as previously you said you wanted to see last 4 Quarters.

Anyway, can you provide a sample of your data and the chart where you want to see this?