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: 
ramcena306
Creator II
Creator II

How to exclude latest month from variable?

Hi All,

PFA variable, I have a variable which shows 24M (Months)stock values.

how to adjust this variable to exclude the latest month?

stalwar1loveisfailsureshqvjontydkpiarvind1494kush141087

1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

add this into your variable

Month -= {"$(=Date(MonthStart(Today()), 'Format'))"}

View solution in original post

11 Replies
Chanty4u
MVP
MVP

add this into your variable

Month -= {"$(=Date(MonthStart(Today()), 'Format'))"}

ramcena306
Creator II
Creator II
Author

hi Chanty, Thanks for the Quick response, But, it's not working for me.

when I use this variable in a chart Expression it's showing 'No data to Display'

ramcena306
Creator II
Creator II
Author

Otherwise, I want to create a new variable to get the stock values for the latest month by using this variable.

How can we do this?

PrashantSangle

are you using alternate state??

why you required scope resolution operator in your expression?

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
shiveshsingh
Master
Master

=Sum({<Year = {"$=(max(year))"} , Month = {"$=(Date(Max(Month),'MMM'))"} >}Data)

You can use this to get last month sales

ramcena306
Creator II
Creator II
Author

Hi Prashant,

Yes we are using Alternate state.

Actually I have to show stock values upto  completed months only,

for that, if I create a second variable  or an expression to get the stock values for the latest month and then I will  substract this value from the result of first variable. Then I will get the required Output.(Because the attached variable giving current month stock values also)

ramcena306
Creator II
Creator II
Author

Hi Shivesh Singh,

This is not my requirement.

shiveshsingh
Master
Master

You can put this in variable, you wrote there to get lastmonth sales.right?

ramcena306
Creator II
Creator II
Author

Hi Shivesh Singh,

Not Last month, to get latest month.