Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
I am currently developing an App that will be used in regions with different number format.
I've got two different types of config values that will be read before the fact table:
NUMBER FORMAT 1
SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
SET TimeFormat='h:mm:ss';
SET DateFormat='DD/MM/YYYY';
SET TimestampFormat='DD/MM/YYYY h:mm:ss[.fff]';
SET MonthNames='ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic';
SET DayNames='lun;mar;mié;jue;vie;sáb;dom';
SET LongMonthNames='enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiembre;octubre;noviembre;diciembre';
SET LongDayNames='lunes;martes;miércoles;jueves;viernes;sábado;domingo';
SET FirstWeekDay=0;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='es-ES';
NUMBER FORMAT 2
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
SET TimeFormat='h:mm:ss';
SET DateFormat='DD/MM/YYYY';
SET TimestampFormat='DD/MM/YYYY h:mm:ss[.fff]';
SET MonthNames='ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic';
SET DayNames='lun;mar;mié;jue;vie;sáb;dom';
SET LongMonthNames='enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiembre;octubre;noviembre;diciembre';
SET LongDayNames='lunes;martes;miércoles;jueves;viernes;sábado;domingo';
SET FirstWeekDay=0;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='es-ES';
I've been testing with different type of objects:
-Block chart
-Pivo table
-Table
-KPI
Test #1
-Loading NUMBER FORMAT 1 (i.e 1.200.989,56)
All the measures have number format with 2 decimal places
For the Region #1, I get the desired result.
Also, the tables keep the format when exported
Test #2
-Loading NUMBER FORMAT 2 (i.e 1,200,989.56)
If we load now the data with the 2nd number format, the data in the objects doesn't change. There is one difference:
The format of the object has changed; it still remains as number but the drop down list appears blank.
However, if I change to Automatic, then Number again, it automatically selects the 2 decimal places format:
Then the numbers appear with the desired format in all the objects:
Does anyone know why does this happen? Is there any other way to switch between different number formats using the same app?
I've also tried using a variable v.FNum and the Automatic format, but it won't export the format correctly: num(Sum({<flag={'3'}>} Euros),v.FNum)
Thanks in advance, have a good day!
I have found the "touchless formatting" technique the easiest way to switch number formats.
https://qlikviewcookbook.com/2016/07/touchless-formatting/
-Rob
Hi @rwunderlich ,
thanks for your post. However, I haven't been able to make it work. Is it possible that "touchless formatting" only works when number format is defined as 'Automatic'within the different objects?
So as to be abIe to export the tables correctly, I need to use 2 decimal places number format within the objects. The only way I've found to change the format correctly while keeping the 2 decimal places number format is by changing:
SET ThousandSep=',';
SET DecimalSep='.';
But every time the app is loaded with a different value for ThousandSep and DecimalSep, I get the blank dropdown.
I am loading:
TempFormatTable:
LOAD
Num(0, '#,##0.00') as EURBilled
AutoGenerate 1;
Services_Bookings:
LOAD *
FROM [lib://BI_Global/99.Shared\2.QVD\XXX.qvd]
(qvd);
DROP TABLE TempFormatTable; // Drop temp table
But I'm not getting the expected results. Am I doing something wrong?
Thanks in advanced!
Yes, the "touchless formatting" would only apply to the default formatting. I would have to dig into the actual implementation of "automatic" to comment further. Same goes for exporting, let me see if I can do some testing.
-Rob
Thanks @rwunderlich once again for your time.