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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Selected field value should store in variable

Hi,

I had three fields they are Group,Min,Max from one table. I had taken Group as field in the listbox,Min & Max as expression in same listbox like followin image:

Capture.PNG

- Now i want to store Min value of A in one variable and Max value in another variable after marking A

- If i select B i want to store Min value of B in one variable and Max value in another variable.

The four variables are like this vMInA,vMaxA,vMinB,vMaxB.

How to solve this problem

14 Replies
swuehl
MVP
MVP

Hi Mr. Nokia,

I think you forgot the stars * in the search string. It must be '*A*'

like this

=if(wildmatch(GetFieldSelections(Group),'*A*'),min({<Group= {"A"}>}Value),'')

Stefan

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Sorry i forgot to give...But what is the use of * here..And also we need to give maximum size for GetFieldSelection. B'coz by default it holds 6 selections of listbox. So i given like this...

=if(wildmatch(GetFieldSelections(Group,'',50),'*A*'),min({<Group= {"A"}>}Value),'')

Thanks a lot Swuehl....

swuehl
MVP
MVP

* is a wildcard, i.e. *A* would match either A, AB, BA, BAB, ....

Please note that Groupnames must be unique even in part, so if you use Group name A and AA, this will be problematic.

Stefan

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

if data is as following  if we get any problem when i write like this

v1=if(wildmatch(GetFieldSelections(Group,'',50),'*CureLaneP*'),min({<Group= {"CureLaneP"}>}Value),'')

v2=if(wildmatch(GetFieldSelections(Group,'',50),'*CureO2LevelAvgA*'),min({<Group= {"CureO2LevelAvgA"}>}Value),'')

CureLaneP
CureO2LevelAvgA
CureO2LevelMaxA
CureO2LevelMinA
CureTimeActualA
CureTimeHighIntensityA
CureTimeLowIntensityA
CureToDemoldTimeA
CureZone1TempAvgA
CureZone1TempMaxA
CureZone1TempMinA
CureZone2TempAvgA
CureZone2TempMaxA
CureZone2TempMinA
swuehl
MVP
MVP

As long as you search in wildmatch with full group names, as you did in your two examples, this should be ok.

For example, if you would have an additional group CureLanePP and you would select only this one, expressions

v1=if(wildmatch(GetFieldSelections(Group,'',50),'*CureLaneP*'),min({<Group= {"CureLaneP"}>}Value),'')

v2=if(wildmatch(GetFieldSelections(Group,'',50),'*CureLanePP*'),min({<Group= {"CureLanePP"}>}Value),'')

would result in min values v1 and v2 set, while you would expect only the min value v2.

Thus, a group name shall not be a subset / part of another group name.

Stefan