Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

specific data variable

Hi All,

@Taoufiq_Zarra   @MayilVahanan 

i have field called Month year and data looks like below

jan 2019

mar 2019

feb 2020

may 2020

jun 2020

0ct 2020

jan 2021

feb 2021

may 2023

here i want to create a variable    to show me that output of .   Oct 2020  ( which is  max month of 2020 year it should be dynamic and it should not change of any other selections )

can any one help on this?

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

Hi @soniasweety 

Hope you're data in date format not in text format.

In text box

last month <= today:

=MonthName(Max({<MonthYear={"<=$(=Today())"}>} MonthYear))

Last month in 2020:

=MonthName(Max({<Year={2020}>} MonthName))

for ignore selection, you can add 1

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

5 Replies
MayilVahanan

HI @soniasweety 

May be try like below

=Date(Max({1<Year={$(=Max(Year))}>}Date)) 

<-- it will provide the Max Date based on selected year and not change based on any selections.

You can derive date based on MonthYear field with help of MakeDate function

Sample:

=Sum({1<Date={'$(=Date(Max({1<Year={$(=Max(Year))}>}Date)))'}>}sales)

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
soniasweety
Master
Master
Author

Hi @MayilVahanan  Thank you. but i need result in text object.

 

cant we do like this?  

last month <= today
or
last month in 2020 
or
max (yearmonth)<2021
 
how can i use above cases here in front end?
MayilVahanan

Hi @soniasweety 

Hope you're data in date format not in text format.

In text box

last month <= today:

=MonthName(Max({<MonthYear={"<=$(=Today())"}>} MonthYear))

Last month in 2020:

=MonthName(Max({<Year={2020}>} MonthName))

for ignore selection, you can add 1

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
soniasweety
Master
Master
Author

=MonthName(Max({<MonthYear={"<=$(=Today())"}>} MonthYear))    this is giving me  feb 2021

 

=MonthName(Max({<Year={2020}>} MonthName))    - this giving me null -

MayilVahanan

Hi 

I think, you don't have Year field. Can you try like below

=MonthName(Max({<MonthYear={"*2020"}>} MonthYear))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.