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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
daanciorea
Partner - Contributor III
Partner - Contributor III

Variable with Parameters

Hi group!

I am using the follow variable

vFormula = Sum({<ID = {1,2}, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13>}DATO)

I use the $1,..., $13 parameters to complete the variable with filters and fields that I need ignore.

If I complete all of $1, ..., $13 the variable work perfect. But, why not work good the variable when I don't complete all of $1, ..., $13?

In some objects I need complete all of $1, ..., $13 but in others don't and in this objects nothing is working. Do any can help me?

Thanks in advance.

Dan.

1 Solution

Accepted Solutions
isorinrusu
Partner - Creator III
Partner - Creator III

Hey,

An option is to use two variables.

So, your first variable would be vSumHours = sum({<$(vConcatFields($1,$2))>}Hrs.), and the second one is vConcatFields = $1=,$2= (etc.). When you call the variable, you would do something like $(vHoras(Cliente)) or $(vHoras(Cliente, Mes)), to ignore only Cliente or both Cliente and Mes.

See you tomorrow for a Special.

Regards,

Your boss.

View solution in original post

1 Reply
isorinrusu
Partner - Creator III
Partner - Creator III

Hey,

An option is to use two variables.

So, your first variable would be vSumHours = sum({<$(vConcatFields($1,$2))>}Hrs.), and the second one is vConcatFields = $1=,$2= (etc.). When you call the variable, you would do something like $(vHoras(Cliente)) or $(vHoras(Cliente, Mes)), to ignore only Cliente or both Cliente and Mes.

See you tomorrow for a Special.

Regards,

Your boss.