Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there an expression that will allow me to show different data types (percentages and whole numbers) in the same column in a Qlik Sense Table? If so, could someone provide the syntax for that? I'm a bit of a novice at scripting.
The column is called "Actual - Previous Week". There are 12 values in the column. Four of the values are whole numbers and the other 8 are percentages.
Any help would be greatly appreciated.
Thank you!
On the front end, you could use e.g.
num(Sum(YourField),If(SomeDimension='Somevalue','#,##0', '#,##0%'))
Using the if() function inside the num() function to pick the format.
On the front end, you could use e.g.
num(Sum(YourField),If(SomeDimension='Somevalue','#,##0', '#,##0%'))
Using the if() function inside the num() function to pick the format.
Thank you, @Or! That worked. I tweaked it a little bit to make it work specifically for my numbers. I ended up using the following script:
=num(([Actual - Previous Week]),If([Measure Name] = 'Cumulative Total of Applications' or [Measure Name] = 'Gates' or [Measure Name] = 'Cumulative Average','#,###', '#,###.##%'))
*Follow-up question: The script made all of the measures mentioned above whole numbers except for the last one, Cumulative Average. Can you see anything wrong with the script that caused the last one not to convert to a whole number?
Thanks again!
Without seeing the formula and input, I can't really guess as to why that might happen. However, if you'd like to convert values to a whole number (rather than display them without a decimal point), consider using Floor() or Round().