Discussion board where members can learn more about Qlik Sense App Development and Usage.
I have a question about data formatiing with my data types. Each type of data needs to be formatted differently.
-Revenue ex: $940,928,430
Rate ex: $2.58
-Amount ex: 250,000,945
This is what I currently have but it's an error, not sure how to format the if statement and the formatting for the values. Let me know your thoughts
=if(data_type= "Rev", '$###,###,###',
if(data_type= "Rate", '$##.##',
if(data_type= "Amt", '###,###,###',
)))
If someone else has the same question here is how I solved it:
I had different scenarios and some more formula pieces to add, but this is the finished product with the formatting I wanted
if(data_type='Rev', Money(Sum({<scenario={'A'}>}data),'$#,##0'),
if(data_type='Amt', num(sum({<scenario={'A'}>}data),'#,##0'),
num(avg({<scenario={'A'}>}data),'#,##0.00')))
Your error is a result of using double quotes instead of single quotes. It also seems to be missing the Num() function that would tell it you want to format as number:
=num(YourFormulaHere,if(data_type= 'Rev', '$###,###,###',
if(data_type= 'Rate', '$##.##',
if(data_type= 'Amt', '###,###,###',
))))
If someone else has the same question here is how I solved it:
I had different scenarios and some more formula pieces to add, but this is the finished product with the formatting I wanted
if(data_type='Rev', Money(Sum({<scenario={'A'}>}data),'$#,##0'),
if(data_type='Amt', num(sum({<scenario={'A'}>}data),'#,##0'),
num(avg({<scenario={'A'}>}data),'#,##0.00')))