Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dollar Sign Expansion + Variable + Set Analysis

equals a messy qlikview expression burrito.

I have an expression variable   vYTDLeads which houses the expression

Sum({$<FISYR={$(#vFisYr)},WKNO={$(#vPWKNO)}>}Leads)

I am looking to insert another set modifier in the form of a $ expansion that is determined on a variable.

the variable would be:  vCMSTotalExp

                    vCMSTotalExp =

               If(vCMSTotal = 1,

                         'ZIP={$(=99999)}',

                         'ZIP-={$(=99999)}'

when inserting EITHER of Zip set analysis expressions into the Sum...Leads) expression, it works as expected, however, I'd prefer if the  expression runs on a button set variable rather than doing an if statement in the vYTDLeads expression.

Any insight in the syntax to get the expreission to work similar to this:

    Sum({$<FISYR={$(#vFisYr)},$(vCMSTotalExp),WKNO={$(#vPWKNO)}>}Leads)

1 Solution

Accepted Solutions
swuehl
MVP
MVP

double check what is actually replaced by your dollar sign expansion of $(vCMSTotalExp).

What you want to have is either

ZIP={99999}

or

ZIP-={99999}

You don't want the if() statement put into the set expression

If(vCMSTotal = 1, 'ZIP={99999}', 'ZIP-={99999}')

Hence you need to define your variable with a leading equal sign, so it gets evaluated and the result is used for the dollar sign expansion.

=If(vCMSTotal = 1, 'ZIP={99999}', 'ZIP-={99999}')


The Little Equals Sign

The Magic of Variables

The Magic of Dollar Expansions

Double check the result of the evaluated variable e.g. in a variable input box.

I then would suggest that you create a straight table chart with no dimension and your expression

  Sum({$<FISYR={$(#vFisYr)},$(vCMSTotalExp),WKNO={$(#vPWKNO)}>}Leads)


hover with the mouse over the expression header, you should see the expression with all DSE expanded.

Carefully check that the full expression is like requested.

View solution in original post

7 Replies
sunny_talwar

Not sure I understand your intention, do you want to use this ->

Sum({$<FISYR={$(#vFisYr)},$(vCMSTotalExp),WKNO={$(#vPWKNO)}>}Leads)

or are you looking for work arounds?

Not applicable
Author

Based on previous experience,

Sum({$<FISYR={$(#vFisYr)},$(vCMSTotalExp),WKNO={$(#vPWKNO)}>}Leads)


SHOULD work, but doesnt.  And i'm not sure why.  It gives me errors in expression in the editor. 

sunny_talwar

Can you try this:

If(vCMSTotal = 1, 'ZIP={99999}', 'ZIP-={99999}')

Not applicable
Author

Same error.

sunny_talwar

Well the expression editor will continue to show an error, because it doesn't understand the variable. But you should still be able to get the output as expected. Have you tried clicking okay to see if the output is coming as expected?

Not applicable
Author

I have tried clicking ok, with the variable if statement as you posted earlier, and

Sum({$<FISYR={$(#vFisYr)},$(vCMSTotalExp),WKNO={$(#vPWKNO)}>}Leads)

as the set analysis expression.

I am getting the standard ‘error in set modifier expression’

Do you think it would help if I adjust the If statement to exlude zip?

So the if statement would be:

If(vCMSTotal = 1,

‘=’ , ‘-=’)

That way the set modifier has a dimension to work off of? Is this a viable work around?

swuehl
MVP
MVP

double check what is actually replaced by your dollar sign expansion of $(vCMSTotalExp).

What you want to have is either

ZIP={99999}

or

ZIP-={99999}

You don't want the if() statement put into the set expression

If(vCMSTotal = 1, 'ZIP={99999}', 'ZIP-={99999}')

Hence you need to define your variable with a leading equal sign, so it gets evaluated and the result is used for the dollar sign expansion.

=If(vCMSTotal = 1, 'ZIP={99999}', 'ZIP-={99999}')


The Little Equals Sign

The Magic of Variables

The Magic of Dollar Expansions

Double check the result of the evaluated variable e.g. in a variable input box.

I then would suggest that you create a straight table chart with no dimension and your expression

  Sum({$<FISYR={$(#vFisYr)},$(vCMSTotalExp),WKNO={$(#vPWKNO)}>}Leads)


hover with the mouse over the expression header, you should see the expression with all DSE expanded.

Carefully check that the full expression is like requested.