Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
vmcintyre
Contributor II
Contributor II

Dynamically formatting a KPI using a variable

Hi All, 

I have a series of KPIs that need to be displayed in £s and either have 'k' or 'm' after them depending on their value, so I need the formatting to be dynamic. 

I've been using the following:

=if($(vOppValue)>1000000, num($(vOppValue)/1000000, '£#,##0.00m'), num($(vOppValue)/1000,'£#,##0.00k')

I'm unable to share my app, as it has client data. 

Many thanks, 

V

1 Solution

Accepted Solutions
vmcintyre
Contributor II
Contributor II
Author

Hi All, 

It's working now. 

if(num($(vOppValue))>1000000,num($(vOppValue)/1000000,'£#,##0.00m'),num($(vOppValue)/1000,'£#,##0.00k'))

🙂

View solution in original post

4 Replies
martinpohl
Partner - Master
Partner - Master

so what's your result now?

has your variable a = (equal) so the value is calculated?

Regards

vmcintyre
Contributor II
Contributor II
Author

Hi, 

Thanks for your reply. 

It won't calculate at all. It just returns a '-'.

Many thanks, 

V

vmcintyre
Contributor II
Contributor II
Author

Apologies, yes, the variable calculates fine. It's a long calculation, that's why I opted to make it a variable. 

vmcintyre
Contributor II
Contributor II
Author

Hi All, 

It's working now. 

if(num($(vOppValue))>1000000,num($(vOppValue)/1000000,'£#,##0.00m'),num($(vOppValue)/1000,'£#,##0.00k'))

🙂