Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

How to select in a field by values which are possible values in other fields?

I have 3 fields, there are Country, City, Geo.

Country: USA,Russia,China,...

City: New York, Shanghai,...

Geo: Russia,New York,Usa,Shanghai,..

I want to select the values(which possible in Country or City) in Geo.

set v_Geo=ActiveDocument.Fields("Country").GetPossibleValues

Is it possible =>

add ActiveDocument.Fields("City").GetPossibleValues into v_Geo?

then ActiveDocument.Fields("Geo").SelectValues v_Geo

5 Replies
Highlighted
Partner
Partner

How to select in a field by values which are possible values in other fields?

Hi,

Please, check if the application attached solves your problem.

Regards,

Highlighted
Contributor III
Contributor III

How to select in a field by values which are possible values in other fields?

Thank you Erich.

Anyway, I would like to know how to combine 2 variables values into 1.

Highlighted
Partner
Partner

How to select in a field by values which are possible values in other fields?

You can create a variable for your case like this (go to document properties -> Variable overview ->Add

vSelections ='(' & concat(DISTINCT CHR(34) & COUNTRY & CHR(34), '|')
& IF( COUNT(DISTINCT COUNTRY)>0,'|') & concat(DISTINCT CHR(34) & CITY & CHR(34), '|') & ')'

Highlighted
Contributor III
Contributor III

How to select in a field by values which are possible values in other fields?

Dear Erich, can it be achieved in Macro?

Highlighted
MVP
MVP

How to select in a field by values which are possible values in other fields?

Probably this.

set field = ActiveDocument.Fields("Geo")
field.selectValues ActiveDocument.Fields("Country").getPossibleValues
field.selectValues ActiveDocument.Fields("City").getPossibleValues,true