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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Leo77
Contributor
Contributor

Dynamically load the latest data

 hi i have a date and i need to show the count of orders in that month in a kpi. some times i dont have data for the current month .so when i load the data it should defaultly show me the latest (what ever is the latest  month)data available

ex: i load the data in november ,but the data doesnt contain any data for november , it should display the octobers data

 

thanks,

leo 

Labels (4)
2 Replies
MendyS
Partner - Creator III
Partner - Creator III

@Leo77 

put the expression in IF statement, for example - 
If (Sum ({<Date = {'11/2022'}>} Sales)>0,

       Sum ({<Date = {'11/2022'}>} Sales),
                        Sum ({<Date = {'10/2022'}>} Sales))

rubenmarin

Hi, you can use set analysis to retrieve the max date with related data, something like:

Sum({<YearMonthNum={$(=Max({<OrderId={"*"}>} YearMonthNum))}>} Value)

To create consecutive yearmonth values you can use: (Year(Date)*12)+Month(Date)