Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Carlaf_93
Creator II
Creator II

Modify imported data

Good morning,

 

i would like to change a value in a data when i'm importing them.

For example:

load * inline [

CLASS, VALUE,

A, 100,

B, 200,

C,209,

C,-120];

 

Ii would like to have --> when CLASS=C and value>0 give me NEW CLASS D,

when CLASS=C and value<0 give me NEW CLASS E

and drop the C class

how can i do it?

 

1 Solution

Accepted Solutions
Taoufiq_Zarra

LOAD
if(A='22720010' and B<0,'DDD',IF(A='22720010' and B>0, 'CC',A)) AS CLASS,
    [A] AS  CLASS,
    [B] AS  VALUE,
    [C] AS  YEAR
   
FROM excel

two field same name !

maye be :

if(A='22720010' and B<0,'DDD',IF(A='22720010' and B>0, 'CC',A)) AS CLASS,
[B] AS VALUE,
[C] AS YEAR

from ...

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

4 Replies
Taoufiq_Zarra

Like ?

Data:

load if(CLASS='C' and VALUE>0,'D',if(CLASS='C' and VALUE<=0,'E',CLASS)) as CLASS, VALUE inline [

CLASS, VALUE

A, 100

B, 200

C,209

C,-120];

 

output :

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Carlaf_93
Creator II
Creator II
Author

LOAD
if(A='22720010' and B<0,'DDD',IF(A='22720010' and B>0, 'CC',A)) AS CLASS,
    [A] AS  CLASS,
    [B] AS  VALUE,
    [C] AS  YEAR
   
FROM excel

 

What's wrong?

Taoufiq_Zarra

LOAD
if(A='22720010' and B<0,'DDD',IF(A='22720010' and B>0, 'CC',A)) AS CLASS,
    [A] AS  CLASS,
    [B] AS  VALUE,
    [C] AS  YEAR
   
FROM excel

two field same name !

maye be :

if(A='22720010' and B<0,'DDD',IF(A='22720010' and B>0, 'CC',A)) AS CLASS,
[B] AS VALUE,
[C] AS YEAR

from ...

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Carlaf_93
Creator II
Creator II
Author

Thank you!! Great help!