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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Shamshad
Contributor II
Contributor II

Currency calculations on buttons

Hi All,

 

I have requirement to convert normal amount into AED & into USD on the basis of button click.Below is my data source

Shamshad_0-1636645960490.png

I have added currencyselection button in qliksense as 

Shamshad_4-1636646675460.png

 

 Lets say user clicked on the AED option so our Total Amount in the qliksense should as 5673.

I have acheived this when i clicked on AED as below

Shamshad_5-1636646708570.png

 

But problem is occuring when we click on USD option,its nothing showing(refer screenshot below).We should have the Total Amount as 1545 on USD selection.

Shamshad_6-1636646752994.png

 

Used Expression on amount column as :

If(GetFieldSelections(Currency_Selection) = 'AED',if(Currency='AED', sum(Amount) * Rate),
If(GetFieldSelections(Currency_Selection) = 'USD',if(Currency='USD', sum(Amount) / Rate2)
)
)

Could anyone please help me in this issue.

Kindly find Datasource sheet & QVF file for the same.

Thanks in advance

 

 

 

 

 

Labels (3)
1 Solution

Accepted Solutions
abhijitnalekar
Specialist II
Specialist II

Hi @Shamshad ,

Please try this.

 

If(
GetFieldSelections(Currency_Selection) = 'AED', sum(Amount * Rate),
If(GetFieldSelections(Currency_Selection) = 'USD',sum(Amount/Rate2),sum(Amount))
)

above expression is working at my end.

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

6 Replies
Digvijay_Singh
MVP
MVP

Looks like below could be the right expression to achieve what you are expecting - 

If(GetFieldSelections(Currency_Selection) = 'AED',if(Currency='AED', sum(Amount) * Rate),
If(GetFieldSelections(Currency_Selection) = 'USD',if(Currency2='USD', sum(Amount) / Rate2)
)
)

Shamshad
Contributor II
Contributor II
Author

Thanks sir for your response.

 

I am getting the result on Clicking AED or USD button as expected.

Shamshad_0-1636708752279.png

 

But when i am taking only Amount expression in table or in kpi its not showing the result.We need to show amount in Kpi too.

Shamshad_1-1636708884781.png

 

Could you please help me out.

Thanks

 

 

abhijitnalekar
Specialist II
Specialist II

Hi @Shamshad ,

Please modify the same expression as 

If(
GetFieldSelections(Currency_Selection) = 'AED',if(Currency='AED', sum(Amount) * Rate),
If(GetFieldSelections(Currency_Selection) = 'USD',if(Currency2='USD', sum(Amount) / Rate2),sum(Amount)
)
)

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Shamshad
Contributor II
Contributor II
Author

Hi @abhijitnalekar

 

I applied above mentioned expression in the kpi but still its not showing the result 😥 .

Shamshad_1-1636719373753.png

 

 

Shamshad_0-1636719335619.png

 

 

abhijitnalekar
Specialist II
Specialist II

Hi @Shamshad ,

Please try this.

 

If(
GetFieldSelections(Currency_Selection) = 'AED', sum(Amount * Rate),
If(GetFieldSelections(Currency_Selection) = 'USD',sum(Amount/Rate2),sum(Amount))
)

above expression is working at my end.

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Shamshad
Contributor II
Contributor II
Author

Hi @abhijitnalekar 

 

Thank you very much,Its working absolutely fine from my end too.

 

Shamshad_0-1636720603913.png