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

Using variables in set analysis

Hi,

      I have used the following expression to show the sum of components for a given system.

     count(DISTINCT{1<System= {'$(vShowSystem)'}>}Component)
 

       Here I have taken the system into a variable usin ga macro.This wrked fine until I had a single value in a variable

       But for multiple values in the variable the Expression is not working

     Could anybody suggest a Workaround.

Regards

Navin Gorapalli

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Can you please upload the qvw file.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
christian77
Partner - Specialist
Partner - Specialist

Try

$(vShowSystem)='SystemA','SystemB',...,'SystemN'

Miguel_Angel_Baeyens

Hello,

This should work. You need to populate your variable taking into account the values you want to use later in set analysis. If they are strings, you need to enclose in single quotes and separate them with commas (as shown above by Christian), if they are numeric, they only need to be comma separated, no quoting needed.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Guys,

         Thank you for all your help.Was able to figure out the problem.

   

         While taking the values into a variable from a macro I have attached ' at the beginning

         and end of the string.

Regards

Navin Gorapalli