Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
alejortizp
Contributor III
Contributor III

Show the last month in the visualization

Good day,

I want to show in the visualization the last month, i am trying to do that but i dont know why doesnt happen. This is my script:

 

if(GetSelectedCount([Qlik_tu_dimen_estados.anio]) => 1, Count([Qlik_tu_hechos.id_tutela]),

Count({<[Qlik_tu_dimen_estados.anio] = {$(=Max([Qlik_tu_dimen_estados.anio] ))} >}[Qlik_tu_hechos.id_tutela])
)

 

Labels (2)
8 Replies
Nicole-Smith

It may have to do with the formatting of your date field.  Try using MaxString() instead of Max().  If that doesn't work, please post a few lines of sample data.

JGMDataAnalysis
Creator III
Creator III

Change => to > =

alejortizp
Contributor III
Contributor III
Author

I have this like the image 1 but i want without a filter show the information of the last month, like the image 2. but when filtering by date show the corresponding filtering

image 1:

 
 
 

imagen 1.PNG

image 2:

 

image 2.PNG

JGMDataAnalysis
Creator III
Creator III

You could use a measure similar to this...

Count({<[MonthYear] = {"$(=Max([MonthYear]))"}, [Month], [Year]>} Distinct [YourField])

alejortizp
Contributor III
Contributor III
Author

i have a problem with that solucion because if i use it when filter by many dates only show de last one.

JGMDataAnalysis
Creator III
Creator III

If(GetSelectedCount([MonthYear]) = 0, Count({<[MonthYear] = {"$(=Max([MonthYear]))"}, [Month], [Year]>} Distinct [YourField]), Count(Distinct [YourField]))
alejortizp
Contributor III
Contributor III
Author

i dont know buy it doesnt work.

JGMDataAnalysis
Creator III
Creator III

Can you share your application with reduced data?