Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

lou_grauss
New Contributor II

Is it possible to show 2 different #KPI's based on the same fields

Hi,

Is it possible to show 2 different #KPI's based on the same fields?

I have this fields:

 

ItemCurrencyPricePurchased UNIT Qty
AUSD250100
BUSD100150
CEUR125,12100
DUSD20200
EEUR2640
FUSD30050
GUSD11015
HUSD11260
IEUR10500
JEUR25400
KEUR50100

Now I like to have 2 #KPI's, 1 with the Sum of the Purchased Value in USD and 1 with the Sum of the Purchased Value in EUR.

So that would be:

#KPI

$ 67.370,00

#KPI

€ 33.552,00

   

ItemCurrencyPricePurchased UNIT QtyPurchased Value
AUSD25010025000
BUSD10015015000
DUSD202004000
FUSD3005015000
GUSD110151650
HUSD112606720
Totall 67370

   

ItemCurrencyPricePurchased UNIT QtyPurchased Value
CEUR125,1210012512
EEUR26401040
IEUR105005000
JEUR2540010000
KEUR501005000
Totall 33552
Tags (1)
1 Solution

Accepted Solutions
ogster1974
Honored Contributor II

Re: Is it possible to show 2 different #KPI's based on the same fields

Yes

KPI 1

SUM({$ <Currency={'USD'}>} PurchasedValue)

KPI 2

SUM({$ <Currency={'EUR'}>} PurchasedValue)

5 Replies
ogster1974
Honored Contributor II

Re: Is it possible to show 2 different #KPI's based on the same fields

Yes

KPI 1

SUM({$ <Currency={'USD'}>} PurchasedValue)

KPI 2

SUM({$ <Currency={'EUR'}>} PurchasedValue)

MVP
MVP

Re: Is it possible to show 2 different #KPI's based on the same fields

Hi,

Try like this, modify your script like below

QVTableName:

Load

Item,

Currency,

Price

[Purchased UNIT Qty],

Price * [Purchased UNIT Qty] AS PurchasedValue

FROM DataSource;


Now use below expressions:

Expression 1:

SUM({<Currency={'USD'}>} PurchasedValue)

Expression 2:

SUM({<Currency={'EUR'}>} PurchasedValue)

Hope this helps you.

Regards,

Jagan.

raju_insights
Contributor III

Re: Is it possible to show 2 different #KPI's based on the same fields

Hi Please see the attached app. Exactly what you needed.

Capture2.JPG

lou_grauss
New Contributor II

Re: Is it possible to show 2 different #KPI's based on the same fields

Thanks for your reply.

Your script worked but strangely the prices were not correct.

I entered the formula in the #KPI and then the prices are correct.

lou_grauss
New Contributor II

Re: Is it possible to show 2 different #KPI's based on the same fields

Thanks, your formula worked!