Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
SunilChauhan
Champion
Champion

how $(vCurrency) value calculated in data visualization

hello all,

In Data visulaization.qvw , how    $(vCurrency) calculated.

the  data Visulalization  is available under example folder

hope someone can help

Sunil Chauhan
1 Solution

Accepted Solutions
Not applicable

OK, here is where you can get confused:

$(vCurrency) still only returns the currency as a string, however there are fields in the Sales table for each currency. In the Data Visualization Sample they use the result of the currency variable to dynamically look at a different currency columns in the Sales Table. Those columns include (numeric) exchange rates for the sales transaction.

Eg. if you select currency "EUR" and look at the "Various Units" tab and "Bar Chart" (CH05)  the expression: Sum (Sales / $(vCurrency)) calculates the Sales divided by the exchange rate stored in column "EUR".

I hope this helps,

Ingo.

View solution in original post

5 Replies
cesaraccardi
Specialist
Specialist

Hi,

The vCurrency variable is defined as: MinString(CURRENCY) and the field CURRENCY is used in the interface flagged as "Always one selected value", this way MinString returns exactly the selected value.

Regards,

Cesar

SunilChauhan
Champion
Champion
Author

Thanks Cesar.

but

Currency field have text value.

and the value showing for $(vCurrency) is in number why??/

Sunil Chauhan
Not applicable

Hi Sunil,

where do you see a number for $(vCurrency)? It will only return the string of the selected currency.

Ingo.

SunilChauhan
Champion
Champion
Author

in various units tab

open any bar chart and see the  sales expression

or

take one text box and type =$(vCurrency).

hope yo understand

Sunil Chauhan
Not applicable

OK, here is where you can get confused:

$(vCurrency) still only returns the currency as a string, however there are fields in the Sales table for each currency. In the Data Visualization Sample they use the result of the currency variable to dynamically look at a different currency columns in the Sales Table. Those columns include (numeric) exchange rates for the sales transaction.

Eg. if you select currency "EUR" and look at the "Various Units" tab and "Bar Chart" (CH05)  the expression: Sum (Sales / $(vCurrency)) calculates the Sales divided by the exchange rate stored in column "EUR".

I hope this helps,

Ingo.