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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to add Alternate States to a variable as a parameter

Hi,

I have the following variable below.  How do I add Alternate States as a parameter to this variable.

vSpend = Sum({<$($1), BRANDLINK={'$2'}>}DISTRIBUTION_AMOUNT)

The Alternate States I have are :  Alternate1, Alternate2 and Alternate3

         

$1 - is used for period - ie YTD, MTD , etc...

$2 - are different brands

Kind regards,

Nayan

24 Replies
Anonymous
Not applicable
Author

Hi Sunny

I wanted to ask, how does the dollar expansion "$3" links to the Alternate State?

Kind regards

Nayan

sunny_talwar

Dollar sign expansion? Where do you see that?

sunny_talwar

Can you share a sample?

Anonymous
Not applicable
Author

I was referring to $3.  Incorrect choice of words.

sunny_talwar

Third parameter in your variable's arguments

$(vSpendTest(vYTD,FNB, Alternate1))

$1 -> vYTD

$2 -> FNB

$3 -> Alternate1

Anonymous
Not applicable
Author

Hi,  thanks for clarifying.

Do you perhaps have an example similar to my query?

Kind regards

Nayan

sunny_talwar

I don't

lorenzoconforti
Specialist II
Specialist II

Hi

Sum({ $(vAlternateState) <Year = {'2018'},Period_ID = {"<100"}, BRANDLINK={'FNB'}>} DISTRIBUTION_AMOUNT)


vAlternateState definition

=if(XYZ = 'abc', '[Alternate1]','[Alternate2]')

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What version of QlikView?

-Rob

Anonymous
Not applicable
Author

Hi Rob

The version I'm using is 11.2

Kind regards

Nayan