Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
hiba_chelbi
Contributor II
Contributor II

Format chiffre

Bonjour.

Dans ma base, j'ai un champ "Code Magasin" qui contient entre autres les valeurs '1', '001' et '0001'. Quand je visualise mes données sur qlikview, ce dernier les traite toutes comme étant une seule valeur et ne m'affiche que '0001' et affecte les lignes correspondantes aux '1' et '001' à la valeur '0001'.

Je m'explique avec un exemple:

Code Magasin          Quantité stockée

1                               20   

001                           30  

0001                         40

L'instruction

Mon_Magasin :

LOAD

[Code Magasin],

[Quantité stockée]

Resident Magasin;

m'affiche:

Code Magasin          Quantité stockée

0001                         20   

0001                         30  

0001                         40

Comment résoudre ce problème?

Merci

3 Replies
chinnuchinni
Creator III
Creator III

abc:


load * Inline [


"Store_Code", "Stored_Quantity"


1, 20  


001, 30 


0001, 40





];


Mystore :


LOAD


text(if(Store_Code= '1' or Store_Code= '01' or Store_Code = '0001',

'0001')) as Store_Code1,

Stored_Quantity


Resident abc;

drop table abc;





sample1.PNG

el_aprendiz111
Specialist
Specialist

Hi

1-option

LOAD *, NUM([Code Magasin],'0000') as NewField;
LOAD * Inline
[
Code Magasin,Quantité stockée
1,20  
001,30 
0001,40
]
;

zro.png

MarcoWedel

Hi,

you cannot load the same numerical value having different text representations in the same field, i.e. all your values '1', '001' et '0001' will be loaded as numerical value 1 having the format of the first occurrence of any of those values.

To keep the values as text (i.e. prevent them from being interpreted as number), you can use the Text() function:

LOAD

Text([Code Magasin]) as [Code Magasin]

...

hope this helps

regards

Marco