Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need to display Y axis in different formats(currencies, percentages, whole numbers) based on the response type filter .
And formats should change based on the expression value.
Please help me .
Here is my expression
=if(match(ResponseType,'###,###,###,##0.0%'),
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value)/100,'#,##0.0%')
,if(match(ResponseType,'###,###,###,##0.00%'),
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value)/100,'#,##0.00%')
,
if(match(ResponseType,'###,###,###,##0%'),
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value)/100,'#,##0%'),
if(match(ResponseType,'$###,###,###,##0'),
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value),'#,##0'),
if(match(ResponseType,'###,###,###,##0.0'),
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value),'#,##0.0'),
if(match(ResponseType,'###,###,###,##0'),
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value),'#,##0'),
sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value)
))))))
Thanks in advance
Since ResponseType already contains the format pattern, you could code a single expression like:
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value)/100, ResponseType)
Now the only issue is whether you should divide by 100 or not. You could take care of that by adding:
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value)/if(ResponseType like '*%', 100, 1), ResponseType)
So one expression instead of many.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Hi, are you ever try using grouped expressions?
With that you can have all your expressions formated independent, and just select what to show
Since ResponseType already contains the format pattern, you could code a single expression like:
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value)/100, ResponseType)
Now the only issue is whether you should divide by 100 or not. You could take care of that by adding:
num(sum({<Metric_or_Datapoint= {'Metric'}, D1Quarter=>} Value)/if(ResponseType like '*%', 100, 1), ResponseType)
So one expression instead of many.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com