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: 
Cassie_L
Contributor III
Contributor III

Selected value vs. variable

Hi, All,

I have a variable formulas to show YTD budget. But when I select Jan - Jun, it will always shows YTD budget instead of Jan - Jun. 

How can I show selected value when I apply filer, and show YTD value when I do not have filter?

Sum({<Version={"Budget"},[Calendar Year]={$(=maxstring([Calendar Year]))},
Month={'<=$(=(max({<Month={$(=month(today()))}>}Month)))'}>}[Net Sales])

 

Labels (1)
1 Reply
udit_k
Partner - Creator II
Partner - Creator II

use below expression :-

 

=sum({<Year={"$(=max(Year))"},Month={"<=$(=num(month(Max([Start Date]))))"}>} value)

 

YTD:-

udit_k_1-1688387157468.png

 

JAN-MAR:-

udit_k_0-1688387111095.png