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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Maddineni_S
Contributor III
Contributor III

Dynamic selection

Hello Members,

 

I have written an expression, by default which should give letest month data "sum({<Year={2022},Month={'May'}>} EX_Data )" but when i select another month from filter it should give the selected month value. can some one guide me to write the expression.

 

thanks in advance. 

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

  • If no selections are made: This will show latest month and latest year
  • If a month is selected and not year: This will show selected Month and latest year
  • if year is selected and not month: This will show latest month for selected year
  • if year and month is selected: This will show selected month and selected year

 

=sum({<
Year={'$(=Max(Year))'}
,Datefield={">=$(=Date(Monthstart(Max(Datefield))))<=$(=Date(Max(Datefield)))"}
>}EX_Data )

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
sergio0592
Specialist III
Specialist III

Hi, 

And if you just try with :

sum({<Year={2022}>} EX_Data )
vinieme12
Champion III
Champion III

  • If no selections are made: This will show latest month and latest year
  • If a month is selected and not year: This will show selected Month and latest year
  • if year is selected and not month: This will show latest month for selected year
  • if year and month is selected: This will show selected month and selected year

 

=sum({<
Year={'$(=Max(Year))'}
,Datefield={">=$(=Date(Monthstart(Max(Datefield))))<=$(=Date(Max(Datefield)))"}
>}EX_Data )

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.