Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
felcar2013
Partner - Creator III
Partner - Creator III

Variables with Parameters

hi

how can i represent a variable which ignores the Dimension?

like:

vSales($1,$2)

where

vSales = sum({$<dim1={a},dim2=>} sales)

with Parameters, how is this representation?

vSales(a,?)

i tried several Options, but None of them worked, do you have an idea on this?

thanks

1 Solution

Accepted Solutions
marcus_sommer

You could use something like this:

vSales:

sum({$1 <$2 = {$3},$4 =>} $5)

and as expression:

$(vSales(, [dim1], 'a', [dim2], [sales]))

See also: Variables.

- Marcus

View solution in original post

8 Replies
marcus_sommer

You could use something like this:

vSales:

sum({$1 <$2 = {$3},$4 =>} $5)

and as expression:

$(vSales(, [dim1], 'a', [dim2], [sales]))

See also: Variables.

- Marcus

petter
Partner - Champion III
Partner - Champion III

Definition of the vSales variable with parameters:

vSales = Sum( {<$<dim1=$1,dim2=$2>} Sales )

Use of the vSales with actual parameters {a} and a space:

vSales({a}, )

notice that you have to have a space after the comma in the above expression - if you don't it will leave the $2 into the resulting evaluation....

Will give you:

Sum( {<$<dim1={a},dim2=>} Sales )

swuehl
MVP
MVP

If you are talking about ignoring the dimension, are you talking about chart dimensions?

Set expression won't ignore chart dimensions, your syntax will just clear user selections in field dim2.

If you need to ignore chart dimensions, look into TOTAL qualifier, with / without additional field list

=Sum(TOTAL Sales)

=Sum(TOTAL<Dim1> Sales)

felcar2013
Partner - Creator III
Partner - Creator III
Author

thanks, did not work

felcar2013
Partner - Creator III
Partner - Creator III
Author

this does not apply in this case, unfortunately i cannot submit data, i figure out another way of doing it

felcar2013
Partner - Creator III
Partner - Creator III
Author

this worked perfectly, thanks

petter
Partner - Champion III
Partner - Champion III

Sorry to hear that. I specifically tested it in a QlikView application and it worked for me. I should have attached the application I guess - since there might be subtle differences in how you apply my instructions in an application that would make a difference...

But I am happy to see that you found a solution that worked for you anyway

felcar2013
Partner - Creator III
Partner - Creator III
Author

thanks Petter

the solution from Marcus worked perfectly. I tried before all solutions like yours, but with no success. I never parametrized everything in the Expression. Now i know it is possible.