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

Set analysis with variable in expression

For analysis I need a result depending expression.
The expressions has to be: 
    =avg({$} DISTINCT DailyProduction)

or:

     =avg({1} DISTINCT DailyProduction)

In a variable vSelect I move the character 1 or $.

I thought that I could use the following expression:

     =avg({=$(vSelect)} DISTINCT DailyProduction)

but unfortunately this expression results always in an error.

Does anyone know a solution for this problem?

12 Replies
swuehl
MVP
MVP

Strange.

Isn't Sunny's sample QVW working for you just fine and demonstrating that the dollar sign expansion is working?

Using what I've suggested above:

=Count({$(vSelect)}DailyProduction)

and a simple input box that changes the variable between the two literals:

2016-06-06 12_37_00-QlikView x64 - [C__Users_Stefan_Downloads_Community_219486 (1).qvw_].png

2016-06-06 12_37_12-QlikView x64 - [C__Users_Stefan_Downloads_Community_219486 (1).qvw_].png

I still assume it's all about how you combine the dollar sign expansion with your variable definition.

Seems like you don't want to share how you exactely do this, so I won't insist on offering more help.

Regards,

Stefan

rennesia
Contributor III
Contributor III
Author

Stefan,

Indeed, the entire document may not be distributed ... So I made yesterday a small test document to post at the community. But, the problem was not reproducible! Everything worked fine.
Conclusion: I will erase a part of the original document and start again.

Thanks for your help.

rennesia
Contributor III
Contributor III
Author

Thanks for help Sunny. I tried several times with bad results, but when I decide to make a new document, everything works fine. (See also my last reaction to Swuehl at Jun 7.)