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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
josephinetedesc
Creator III
Creator III

if statement

Hi

this is what I want to do in QlkView script

IF(

condition1. if statusNumber <20, give stsNumber,

condition 2.  if statusNumber is null (or text - this picks up the NULL from SQL), give stsNumber of 0

condition 3. (if the date and the id number is the same), and (there are 2 or more statusNumbers) -, give the smallest stsNumber)

AS stsNumberGiven

The third conditions is the only condition where the there will be more than 1 statusNumber

Any help greatly appreciated - I have exhausted my skill set

Jo

Labels (1)
1 Reply
sunny_talwar
MVP
MVP

From what I understand, the below might be useful (you may need to adjust it based on your need):

Table:

LOAD yourFiels,

          statusNumber,

          stsNumber,

          date,

          idNumber

FROM Source;

Join(Table)

LOAD date,

          idNumber,

          statusNumber,

          Min(stsNumber) as MinstsNumber
Resident Table

Group By date, idNumber, statusNumber;

TableFinal:

LOAD *,

          If(Len(Trim(statusNumber)) = 0 or IsText(statusNumber), 0, MinstsNumber) as srsNumberGiven

Resident Table;

DROP Table Table;