Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

data go wrong in dual()

for the table that has money variable that has different currencies for each value.

I loaded table with the sentences below.

LOAD

     money,//text that contains currency symbol and ,(comma)

     PurgeChar(money,'0123456789,') as Currency_Symbol,

     Dual(money, Num(PurgeChar(money,'$€£RCHF₹¥₩kr'))) as money_dual

Resident Temp;

The correct value from Temp is money text column, and extract Currency_Symbol correctly, but in money_dual column some of the value go wrong...(except dollar sign$)

currency.PNG

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

I have attached a QVF and here is a couple of screenshots from the app:

2017-02-24 00_01_03-Qlik Sense Desktop.png

2017-02-24 00_01_17-Qlik Sense Desktop.png

View solution in original post

6 Replies
petter
Partner - Champion III
Partner - Champion III

That is the limitation of dual-values in Qlik. It is designed so one particular numeric value matches one and only one text-value. So if you have the same amount in different currencies it will be the currency that comes first in your load that "wins". Then the text value associated with that particular numeric value (which have no notion of currency at all) that decides which currency will be shown.

So for your purpose you just have to store currency in a separate field in the load and either concatenate the two fields in the charts you are making or display them in separate columns.

You can however use the Dual()-function in your charts by joining the currency symbol and the amount like this:

=Dual( Curr&Val, Val )

It will be right adjusted and act like a number in all calculations....

Not applicable
Author

thank you for your answer!!!

I did what you suggested, but it still gives the same result....

Dual(purgechar(money,'0123456789,')&Num(keepchar(money,'0123456789')), Num(keepchar(money,'0123456789'))) as money_dual

above is my code for money_dual

but it's result is just same as picture above...

petter
Partner - Champion III
Partner - Champion III

You will have to have two separate fields. You can't use Dual() to achieve what you want in the load script and subsequently in the data model.

You can in your UI use the Dual to get the display correctly and avoid the problems you pointed out. I have a full test-application to prove that it works if you want to investigate it?

Not applicable
Author

I would really appreciate it if you send it to me!!

petter
Partner - Champion III
Partner - Champion III

I have attached a QVF and here is a couple of screenshots from the app:

2017-02-24 00_01_03-Qlik Sense Desktop.png

2017-02-24 00_01_17-Qlik Sense Desktop.png

Not applicable
Author

I really appreciate your help!!