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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement - Changing a field

Hi,

Very new to Qlikview and this is my first question.

I am reading from a SAP SQL database and I have monetary values I need to use. These are all positive values and there is a seperate field with an indicator which identifies if the field is really a negative value.

I would normally write some code which would say the following:

IF SHKZG = 'H'.

WRBTR = 0 - WRTBR .

ENDIF.

Where SHKZG if the indicator field and WRBTR is the value field.

How do I do this in Qlikview, ideally in a scritp which would be saving to a QVD file for later use.

Thanks in anticipation.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Paulw,

In the load script you could add something like:

LOAD

...

...

IF(SHKZG = 'H',0-WRTBR,WRTBR) as RealWRBTR,

.....

By doing this you will have a new field called RealWRBTR that has a negative value if the SHKZG is 'H' or has a positive value in all other cases.

Regards,

Joao

View solution in original post

2 Replies
Not applicable
Author

Hi Paulw,

In the load script you could add something like:

LOAD

...

...

IF(SHKZG = 'H',0-WRTBR,WRTBR) as RealWRBTR,

.....

By doing this you will have a new field called RealWRBTR that has a negative value if the SHKZG is 'H' or has a positive value in all other cases.

Regards,

Joao

Not applicable
Author

Hi Jalmeida,

Many thanks for your quick response, it works perfectly.

Thanks again.

Regarda,

Paulw