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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Ricky16
Contributor
Contributor

Group field values in IF statement

Hi everyone,

I'm new in qlikview and i have a doubt:
I have a field named Status and i have 3 distinct values (O, C, R), so i need to join O + R and give a name 'Open'. But i need to isolate Status as Open with just Open too. This is the script i have:
If(STATUS = 'O', 'Open', If(STATUS = 'C', 'Close', 'Reopen')) as Status

thanks

Labels (1)
5 Replies
sunny_talwar

A single row will say O + R, or this is across multiple rows? What is the common field we are checking O and R against?
Ricky16
Contributor
Contributor
Author

In Status field i only have values 'O' (Open), 'R' (Reopen) and 'C' (Closed)

If status is O or R so it's 'Open' but if it's only R it need to be named as 'Reopen'

sunny_talwar

But a single row can ever have O or R, right? Do you have a transaction id against which are checking this? Meaning

Transaction Status
123 O
123 R

so, now the Transaction 123 will be Open

Transaction Status
345 R

but transaction 345 will be Reopen?
jonathandienst
Partner - Champion III
Partner - Champion III

It sounds like you need two fields. A single field in a record will not be able to reflect both conditions.
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
avinashelite

Try like this : Create an new field with the inline load that should take care 

LOAD * inline 

[

Status , New_Status

O,Open

R,Open

R,Reopen

C,Closed

];

Now use the New_Status field that will server the purpose