Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dzhsa001
Contributor III
Contributor III

Selection based on aggregation

Hello community,

I have a pivot table that is of the following structure:

field1field2field3var1var2var3
2017countryAcity0.052101

What I want is to select all countries from the dataset that have a variable [var3] value as "1" by clicking on a button. I have tried to do the following in the search string:

=if (Aggr($(var3),field2)=1, field2)

But, it is not returning anything. Of course, I performed concatination with "|". Does anyone has an idea on how to perform this?

Thanks

1 Solution

Accepted Solutions
prat1507
Specialist
Specialist

Use this

='('&chr(34)&Concat(Distinct(if (Aggr($(var3),field2)=1, field2)),chr(34)&'|'&chr(34))&chr(34)&')'

View solution in original post

6 Replies
vinieme12
Champion III
Champion III

can you post a sample app?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
YoussefBelloum
Champion
Champion

Hi,

Try this:

  • Create a variable vTest

  • Associate the variable with an action via a button or textobject: Set the variable to 1 for example when you click on the button.

  • create a listbox with an expression like this:

                =if(vTest=1,if(var3=1, field2),field2)

prat1507
Specialist
Specialist

Use this

='('&chr(34)&Concat(Distinct(if (Aggr($(var3),field2)=1, field2)),chr(34)&'|'&chr(34))&chr(34)&')'

dzhsa001
Contributor III
Contributor III
Author

I've done the same, apart from the "distinct", but no results. Only ("")

prat1507
Specialist
Specialist

Paste a text box and check what are you getting, please ping me what you're getting.

It should be like ("Value 1"|"Value2"|"Value 3")..... something like this!!


Regards
Pratyush

dzhsa001
Contributor III
Contributor III
Author

Yes, I realized that I should get something in the mentioned form, but as a result I am getting ("") .