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

Dynamic Variable Name

Hi All,

Say I have data for 3 countries, USA, UK, and Canada and I set three variables.

vUSAScaling = .1

vUKScaling = .2

vCanadaScaling = .3

I'd like to have a measure that is

sum(Sales) * $(vCountryScaling) and have the value of vCountryScaling reflect my selection for country.  I have tried doing something like $('v$(=GetFieldSelections(Fund))Scaling') but have not had any luck.  Does anyone have any ideas?

Thanks!

Mark

1 Solution

Accepted Solutions
5 Replies
m_perreault
Creator III
Creator III
Author

I figured out part of it

$(=Concat('v' & getfieldselections(country) & 'Scaling')) 

will work but now I am running into a different issue.  I want to have a table like below with my measure using the dynamic variable but since I am not making selections it will not work.  I have tried using $(=concat('v' & concat(distint Country) & 'Scaling')) but it is not working.

Country    ScaledSales

USA       sum(Sales) * $(=Concat('v' & getfieldselections(country) & 'Scaling'))

UK

Canada

Thanks!

prat1507
Specialist
Specialist

Please see the attached app for your reference.


Regards
Pratyush

m_perreault
Creator III
Creator III
Author

Thank you Pratyush, I apologize I am not able to download qvw's at this time would you be able to send a screenshot of what you did?

prat1507
Specialist
Specialist

alert-512.png

m_perreault
Creator III
Creator III
Author

Perfect thank you!