Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Formatting altered when using a dynamic expression

Hi

I have an app where the user can choose the data shown in a chart  / table based on an inline loaded list.  I don't seem to be able to get any consistent formatting!  As in the attached app, when I choose one of the metrics that are ratios, then all is good.  The minute I try to use the formats that are straight summed values I often get exponential notations,  or what have you.

Any ideas?


Cheers

!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try this:

If

(only({$< QuoteSummaryKPIType  = {'Cover Type'} , QuoteSummaryKPIDetails =    > } %agg)  = 'sum'
,
num(sum({$< QuoteSummaryKPIType  = {'Cover Type'} , QuoteSummaryKPIDetails =    > }  $(=%metric)),'#,##0') 
,
num(avg({$< QuoteSummaryKPIType  = {'Cover Type'} , QuoteSummaryKPIDetails =    > } $(=%metric)) ,'#,##0%')
)


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Try this expression:

IF (%agg  = 'sum'

,num(sum({$< QuoteSummaryKPIType  = {'Cover Type'} , QuoteSummaryKPIDetails =    > }  $(=%metric)),'#,##0') 

,num(avg({$< QuoteSummaryKPIType  = {'Cover Type'} , QuoteSummaryKPIDetails =    > } $(=%metric)) ,'#,##%')

)


talk is cheap, supply exceeds demand
Not applicable
Author

Excellent! That worked, and I should have worked it out....

However.. I've noticed the issue can be recreated even when the formatting has been fixed, by clicking on the QuoteSummaryKPIDetails  column. 

I used  'QuoteSummaryKPIDetails =    >'  in the set analysis, so it doesn't filter the data, but it still affects the formatting, which is quite odd!  Any more ideas?  Cheers!

Gysbert_Wassenaar

Try this:

If

(only({$< QuoteSummaryKPIType  = {'Cover Type'} , QuoteSummaryKPIDetails =    > } %agg)  = 'sum'
,
num(sum({$< QuoteSummaryKPIType  = {'Cover Type'} , QuoteSummaryKPIDetails =    > }  $(=%metric)),'#,##0') 
,
num(avg({$< QuoteSummaryKPIType  = {'Cover Type'} , QuoteSummaryKPIDetails =    > } $(=%metric)) ,'#,##0%')
)


talk is cheap, supply exceeds demand
Not applicable
Author

Fantastic! Cheers.. much appreciated.  So you need to put the output from the selection that is used in set analysis too? Good to remember that! Thanks again.