Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
lucasx15
Contributor III
Contributor III

Filter to look at the previous row of the table and not the current one

Good morning, I would like some help. I need to solve the following situation. I need my current date filter to be selected to select the previous row of the table and not the current one. Well, I need the result of the previous month to be shown when selecting the current month, that is, the month before the accrual month and in a period equal to or less than 30 days Example, January/2023 returns me the data of December/2022.
What I've done so far:

First, I built the 30 days interval, which I need through a flag:

LOAD NR_CLIENT	,						
	 CD_PEOPLE,					
	 DT_ENT,
	 DT_ALT,
	 IE_TIPY,
if(Match(IE_TIPY,1) AND Match(Peek(IE_TIPY),1) AND CD_PEOPLE= Peek(CD_PEOPLE) AND Peek(CD_MOTV)=12 and DT_ENT-Peek(DT_ALT)<=30,' < 30 Days') AS FL_30DAY
RESIDENT CLIENT_FULL_TABLE;

 

Second, I built my expression:

=Count({<FL_30DAY={'FL_30DAY'},
		DT_CALEN_MONTH=, //Ignore filter
		DT_CALEN_YEAR=, //ignore filter
		DT_ALT_MONTHYEAR={">=$(=DATE(MIN(DT_CALEN),'MMM/YYYY'))<$(=DATE(MAX(DT_CALEN),MMM/YYYY'))"}>}
	DISTINCT NR_CLIENT)
		
*// na linha atal nao pode olhar
Labels (1)
0 Replies