Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rvijayanth
Creator
Creator

Help in writing an expression

What is wrong in the following expression?

In a table, I'm trying to show my dimension "Year" only for the years where it is greater than a variable where is the user is setting. Variable name is vLimit.

{<[Year] = {">$(vLimit)"}>}

I'm getting an invalid dimension error. What is wrong with this syntax? Please help

7 Replies
craigsutton
Creator
Creator

Are you trying to do a calculated dimension or modify your expression with set analysis? If you are modifying your expression then what does your full expression look like?

sunny_talwar

May be like this

Sum({<[Year] = {">$(=vLimit)"}>}Measure)

rvijayanth
Creator
Creator
Author

This is what I'm using now. But here is my issue:

Lets say I have data since 2005. By default, in a table, we display data for the last 5 years. We pass a variable in the measure to show only the sum for past five years. Users can click a button to change the variable which will then display data for all years (since 2005). Everything is good so far.

But when the table opens by default, users are allowed to select a year which is, lets say 2006, (which is outside of last 5 years). For this selection, the table is not showing data since the measure is trying to calculate sum for for last 5 years and the user selection for year is 2006.

So I want to somehow only show past 5 years in "year" selection in table and show all years to select ONLY when the users click in "All Years" button.

rvijayanth
Creator
Creator
Author

Lets say I have data since 2005. By default, in a table, we display data for the last 5 years. We pass a variable in the measure to show only the sum for past five years. Users can click a button to change the variable which will then display data for all years (since 2005). Everything is good so far.

But when the table opens by default, users are allowed to select a year which is, lets say 2006, (which is outside of last 5 years). For this selection, the table is not showing data since the measure is trying to calculate sum for for last 5 years and the user selection for year is 2006.

So I want to somehow only show past 5 years in "year" selection in table and show all years to select ONLY when the users click in "All Years" button.

rahulpawarb
Specialist III
Specialist III

May be this.

Regards!

Rahul

rvijayanth
Creator
Creator
Author

Im talking about qliksense app. How do I convert this to QlikSense?'

Can you just show the dimension and measure expression?

rahulpawarb
Specialist III
Specialist III

Hello Vijayanth,

I used QlikView actions from button click i.e. Action Type = Selection & Action = Select in Field for field CalendarYear with Search String ='>=' & vLimit.

Regards!

Rahul