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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Average Calculation

Hello All,

I am trying to get the average value for my currency conversion,


Here is the logic I am trying to apply in QlikView,

Set vCurrencyEUR = select avg(currency_ rate) where Reimburse_Cur=EUR and Spend_Cur =USD

Set vCurrencyINR = select avg(currency_ rate)where Reimburse_Cur=INR and Spend_Cur=USD

Please help me how to convert this into working QlikView scripts.

3 Replies
sergio0592
Specialist III
Specialist III

Try with as expression :

=avg( {<Reimburse_Cur={"EUR"}, Spend_Cur ={"USD"}  >}   currency_ rate)


=avg( {<Reimburse_Cur={"INR"}, Spend_Cur ={"USD"}  >}   currency_ rate)

But Set expression not worked in the load script. You must be in front end.

Anonymous
Not applicable
Author

You would need to build a  summary table. Example for first one.

EURCurrency:

Load

avg(currency_rate) as AvgCurrencyRate

Resident YourDataTable

where Reimburse_Cur='EUR' and Spend_Cur='USD';

let vCurrencyEUR= peek('AvgCurrencyRate');

Drop table EURCurrency;

Not applicable
Author

Thank you Jean and Wallo for your suggestions. Let me work on both suggestions and will get back to you