Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF statement

Hi everybody,

I'm trying actually to solve a problem concerned a Qlikview dashboard,

The dashbord takes some information about differents plant in Canada. I have to change the name of one of them in the report without changing the name in the database.

For exemple: I have a windows that contain name of plant, them adresses, rate, ...etc. The name of one of those plants is ABS, and I want that the name change to AAA. I know that i have to use an If statement in my proprieties, but i don't know where can i put it, and what's the correct form of the request.

Thank you for your support!!

9 Replies
Not applicable
Author

Hi Walid,

If you a Chart and using the Name of the Plant as one of your dimanesion, you can use 'If' condition.

For Example:

If you want to change the name of the plant from ABS to AAA,

you can use:

=if(Name_of_Plant = 'ABS', 'AAA', Name_of_Plant)

What this will do is whenever the name ABS comes in the report, it will change it to AAA and otherwise it will fetch the data from the field Name_of_Plant.

I hope this might help your query..

jagan
Luminary Alumni
Luminary Alumni

Hi,

In script you can do like this

Data:

LOAD    

If(Name_of_Plant = 'ABS', 'AAA', Name_of_Plant) AS Name_of_Plant,

'

'

'

FROM DataSource;

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Change name.png

Hi everybody,

Thank you for your responses. I tried to do what you told, but my request did not work.

This is my script

MAPPING LOAD DISTINCT

     LDE_VALUE,       // DC Code

     INT_DESC,  //DC Name

     If(INT_DESC = 'MANTENO DC', 'YC Kennewick Coldstor DC', INT_DESC) AS DC

FROM

INT_XREF.qvd

(qvd)

WHERE

  upper(trim(INT_TYPE)) = 'PLT';

I want to change the display from  'MANTENO DC' to 'YC Kennewick Coldstor DC'

Thank you so much for your help

MayilVahanan

Hi

You are using mapping load? so you can use only two fields in it. So try like this

MAPPING LOAD DISTINCT

     LDE_VALUE,       // DC Code

     If(INT_DESC = 'MANTENO DC', 'YC Kennewick Coldstor DC', INT_DESC) AS DC

FROM

INT_XREF.qvd

(qvd)

WHERE

  upper(trim(INT_TYPE)) = 'PLT';

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi,

I tried it. Nothing has changed. 'MANTENO DC'  is always on the dashboard....

Thank you for help

Not applicable
Author

Hi,

I tried it. Nothing has changed. 'MANTENO DC'  is always on the dashboard....

Thank you for help

MayilVahanan

Hi

Can you provide a sample file

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi Walid,

You are using mapping load, Are you using this data with applymap in another load? If not then this table will be gone after your load is complete.

If yes try, just a shot hope you have no empty space in data.

If(trim(INT_DESC) = 'MANTENO DC', 'YC Kennewick Coldstor DC', INT_DESC) AS DC

rustyfishbones
Master II
Master II

Hi,

Have you tried using the REPLACE Function in your script

REPLACE(Plant,'ABS','AAA') AS Plant

or create a list box expression

REPLACE(Plant,'ABS','AAA')

HTH

Regards

Al