Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for
Did you mean:
Contributor III

## Variable Extension and Pick Function

Good Afternoon,

We are using the variable extension and pick function shown above to have 6 different options for a KPI on our sheet. There are 6 different toggle buttons to flip between them. Everything is working perfectly, except one of our options is in Sales (\$) and the rest of the 5 are all in units. Is it possible to change the formatting so only the first option shows as \$?

The KPI expression is:

pick(vDashboard,
Sum([ TD Quota]),
Sum([ FFX Quota]),
Sum([IV  Quota]),
Sum([Product Quota]),
Sum([Base Quota]),
Sum([HSM Quota]))

There is obviously the number formatting drop down, but as far as I can tell whichever option you pick then applies to all 6 of the variations.

Nolan

Labels (5)

• ### Variables

1 Solution

Accepted Solutions
Creator III

You were missing one comma in the  expression  num(Sum([HSM Quota])'#,###.00')

Below is the correct expression..

pick(vDashboard,
num(Sum([TD Quota]),'\$#,###.00'),
num(Sum([FFX Quota]),'#,###.00'),
num(Sum([IV Quota]),'#,###.00'),
num(Sum([Product Quota]),'#,###.00'),
num(Sum([Base Quota]),'#,###.00'),
num(Sum([HSM Quota]),'#,###.00')
)

7 Replies
Creator III

you can use the num function with the sum.

num(sum(Sales),'\$#,###.00') )

https://help.qlik.com/en-US/sense/February2021/Subsystems/Hub/Content/Sense_Hub/Scripting/Formatting...

Contributor III
Author

Thank you for the response!

I have changed the Formatting drop down to 'Number' and added this to the expression:

pick(vDashboard,
num(Sum([TD Quota]),'\$#,###.00'),
Sum([FFX Quota]),
Sum([IV Quota]),
Sum([Product Quota]),
Sum([Base Quota]),
Sum([HSM Quota]))

Unfortunately the first toggle still appears as Units. Is this the correct notation? Any other suggestions?

Creator III

add the num to other expressions of sum

like num(sum( [yourfieldname],'#,##0')

also check the property of the number expression as below.

Contributor III
Author

I have tried this and am still getting an error: 'error in expression: ")" expected'

I believe my syntax is correct, so not sure what the problem is. Any advice?

pick(vDashboard,
num(Sum([TD Quota]),'\$#,###.00'),
num(Sum([FFX Quota]),'#,###.00'),
num(Sum([IV Quota]),'#,###.00'),
num(Sum([Product Quota]),'#,###.00'),
num(Sum([Base Quota]),'#,###.00'),
num(Sum([HSM Quota])'#,###.00')
)

Creator III

You were missing one comma in the  expression  num(Sum([HSM Quota])'#,###.00')

Below is the correct expression..

pick(vDashboard,
num(Sum([TD Quota]),'\$#,###.00'),
num(Sum([FFX Quota]),'#,###.00'),
num(Sum([IV Quota]),'#,###.00'),
num(Sum([Product Quota]),'#,###.00'),
num(Sum([Base Quota]),'#,###.00'),
num(Sum([HSM Quota]),'#,###.00')
)

Contributor III
Author

sorry for the silly mistake!

Thank you I have now put in the correct expression and I have changed the Number Formatting to measure expression. However when I use the Toggles the number formats are all still the same:

(1st KPI which should be \$)

(2nd KPI which should be #)

Creator III

Is it possible to attach a sample qvf file to really look at the chart object and expressions? otherwise it is difficult to understand the issue.