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: 
Awais-Ashraf
Contributor
Contributor

Max year Max month

Hello ! i am facing this issue when i write this expression Sum({<[Year]={$(=Max([Year]))},[Month]={$(=Max(Month))}>}[Sales Amount]) i get "0" as output but when i write it as Sum({<[Year]={$(=Max([Year]))},[Month]={$(=MaxString(Month))}>}[Sales Amount]) i get the desired output but when i want to have the output for Last month and Sum({<[Year]={$(=Max([Year]))},[Month]={$(=MaxString(Month)-1)}>}[Sales Amount]) i dont see any output. as we cannot subtract int from String. Please Help..
1 Solution

Accepted Solutions
andoryuu
Creator III
Creator III

In your dataload put Num() around your month field to ensure it is read in as an integer instead of a string. Then you can go back to using Max() and subtracting from it.

View solution in original post

1 Reply
andoryuu
Creator III
Creator III

In your dataload put Num() around your month field to ensure it is read in as an integer instead of a string. Then you can go back to using Max() and subtracting from it.