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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
pablolabbe
Partner Ambassador
Partner Ambassador

Select value of Last transaction for each product in a range of periods

I have attached a sample application.

My problem is : selecting a range of dates (data_ocorrencia) the table need to show the records as show on right tables. I have detached the table to show the desired result. I couldn't achieve this using set analysis and IF conditions.

The objective is simple:

For each prd_id (product), show me the value (valor) of the last transaction based on nro_ocorrencia (occurrence number) according to a selected range of dates or all dates.



Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button! | Follow me on Linkedin
1 Solution

Accepted Solutions
pablolabbe
Partner Ambassador
Partner Ambassador
Author

Problem solved without set analysis, only a simple if with aggr function:

sum(if (ocorr_id= aggr(nodistinct max(ocorr_id),prd_id), valor))



Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button! | Follow me on Linkedin

View solution in original post

1 Reply
pablolabbe
Partner Ambassador
Partner Ambassador
Author

Problem solved without set analysis, only a simple if with aggr function:

sum(if (ocorr_id= aggr(nodistinct max(ocorr_id),prd_id), valor))



Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button! | Follow me on Linkedin