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: 
Rainer1
Contributor II
Contributor II

Use Variable Field Entry in Tab Formula

Hello everybody,
I am using QlikView for a few years but now struggeling with a small modification.

I have created a table for price analysis of sales items. So far it worked quite well as I had used fixed formulas for each row. Now I want to make the analysis more flexible by having the possibility to enter the relevant year with a variable field (see field indicated with an arrow). The year I have entered should be recoginzed in the formula. But it is not working.

What is wrong? How does the formula exaclty need to be written?

Thanks in advancePicturePicture

Labels (2)
1 Solution

Accepted Solutions
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

If you want the selected value to be appeared in the set you can use below set in your expression

e.g Sum({<Year={"$(=GetFieldSelections(Year))"}>} Sales)

If you are trying to get the entered Year from variable input you can use the variable instead.

e.g Sum({<Year= {"$(vVariable)"}>}Sales)

 

Hope this helps.

Thanks,

Ashutosh

View solution in original post

5 Replies
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

If you want the selected value to be appeared in the set you can use below set in your expression

e.g Sum({<Year={"$(=GetFieldSelections(Year))"}>} Sales)

If you are trying to get the entered Year from variable input you can use the variable instead.

e.g Sum({<Year= {"$(vVariable)"}>}Sales)

 

Hope this helps.

Thanks,

Ashutosh

Rainer1
Contributor II
Contributor II
Author

Thanks Ashutosh,
this was exactly what I am looking for. Now my tab calculation works perfectly.
BR
Rainer

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Great 🙂

Rainer1
Contributor II
Contributor II
Author

How can I add a second variable which has to be matched into the formula Sum({<Year= {"$(vVariable)"}>}Sales)?
I tried Sum({<Year= {"$(vVariable)"}>};{<Month= {"$(vVariable2)"}>}Sales) and other variations but without success.

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

try 

Sum({<Year= {"$(vVariable)"} Month= {"$(vVariable2)"}>}Sales)

There is an issue with set expression syntax.