Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ruben_moya
Creator
Creator

same app with different number formats

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

ruben_moya_0-1625832752361.png

 

For the Region #1,  I get the desired result. 

Also, the tables keep the format when exported

ruben_moya_1-1625832752418.png

 

 

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.

ruben_moya_2-1625832752367.png

 

However, if I change to Automatic, then Number again, it automatically selects the 2 decimal places format:

ruben_moya_3-1625832752469.png

 

Then the numbers appear with the desired format in all the objects:

 

ruben_moya_4-1625832752375.png

 

 

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!

4 Replies
rwunderlich

I have found the "touchless formatting" technique the easiest way to switch number formats. 

https://qlikviewcookbook.com/2016/07/touchless-formatting/

-Rob

ruben_moya
Creator
Creator
Author

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.

ruben_moya_1-1626077455559.png

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!

rwunderlich

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

ruben_moya
Creator
Creator
Author

Thanks @rwunderlich  once again for your time.