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: 
swarup_malli
Specialist
Specialist

Passing current selection from list box to a variable used in straighttable

!I was hoping if i could get some assistance regarding this requirment.

I need to pass selected values from list box to  variable being  used in straight table.

ex:

lets say the label I'm using is

    = vCurrentYear & ' '& 'Donors'

I need to pass values from a listbox called campaignyear which contains values from 2007 to 2011. to the variable (vCurrentYear).

I'm using qlikview version 9.

the expression for column 2010 is :

sum({$<CAMPAIGNYEAR = {$(=num(vCurrentYear))},TrackParm.CAMPAIGNSTATUS = {"F"},TrackParm.CAMPAIGNACCOUNT = {"18"},TrackParm.CAMPAIGNTYPE= {"empl"}>}TrackParm.NUMBEROFDONORS))

the expression for column 2009 is :

sum({$<CAMPAIGNYEAR = {$(=num(vCurrentYear -1))},TrackParm.CAMPAIGNSTATUS = {"F"},TrackParm.CAMPAIGNACCOUNT = {"18"},TrackParm.CAMPAIGNTYPE= {"empl"}>}TrackParm.NUMBEROFDONORS)).

When I choose year 2008 , the 2 colomn expressions must show me sum of sales for year 2008 and 2007.

  if i choose 2011 , i need the expresssion to show me sum of sales for 2011 and 2010.

Thank you

Swarup

1 Solution

Accepted Solutions
rahulgupta
Partner - Creator III
Partner - Creator III

try this:

vCurrentYear=GetFieldSelections(Year)

For current Year Selection:

sum({$<CAMPAIGNYEAR = {$(vCurrentYear)},TrackParm.CAMPAIGNSTATUS = {"F"},TrackParm.CAMPAIGNACCOUNT = {"18"},TrackParm.CAMPAIGNTYPE= {"empl"}>}TrackParm.NUMBEROFDONORS))

View solution in original post

2 Replies
rahulgupta
Partner - Creator III
Partner - Creator III

try this:

vCurrentYear=GetFieldSelections(Year)

For current Year Selection:

sum({$<CAMPAIGNYEAR = {$(vCurrentYear)},TrackParm.CAMPAIGNSTATUS = {"F"},TrackParm.CAMPAIGNACCOUNT = {"18"},TrackParm.CAMPAIGNTYPE= {"empl"}>}TrackParm.NUMBEROFDONORS))

swarup_malli
Specialist
Specialist
Author

Hi Rahul,

   The solution you gave is perfect, I can't thank you enough.

Regards

Swarup