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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Please help regarding below example..

Hey,

Let say i have an input box and i entered a year. According to that year i want the sum of salary.

How can i achieve this ??

How to put input box where user can input value and how to get sum of salary according to inputed value ??

Can anyone help??

Thanks

17 Replies
nikhilgarg
Specialist II
Specialist II
Author

Hey,

I cannot get your point fully. After loading two tables above. If i made listbox and select dimension Year , then how would (sYear) matches with selected year ?? how does (sYear) mapped with value in list box ??

khalander
Creator II
Creator II

Hi,

Create one empty variable like below screenshot

varible.png

Then create new Input box and add that empty variable like below.

INPT.png

Then add expression as Sum({<Year={$(vInputYear)} >} Value) like below image.

Chart_exp.png

After that enter year in input box it will effect in chart also because we have given that variable in that chart also.

Regards,

khalander

Anonymous
Not applicable

see Screen shot of khalander

I could not make it better

nikhilgarg
Specialist II
Specialist II
Author

Hey,

If i go your way den how to hide defined variable say vyear??

senpradip007
Specialist III
Specialist III

PFA. Hope it will help you.

flipside
Partner - Specialist II
Partner - Specialist II

It all depends on what you are trying to do. If you just want the user to see the sum of salary for their selected year, then just have a listbox or multibox for the Year field and use sum(salary) for the expression. My solution (and the solution using variables) allows the user to select a year (using the field sYear or entering data to be stored in a variable) and see the sum of salary ignoring any selections in the Year field.

nikhilgarg
Specialist II
Specialist II
Author

Hey,

Thanks a lot. Thanks

khalander
Creator II
Creator II

Hi nikhil,

No need to hide variable once you/user enter the required year then it will display in chart.

Regards,

khalander