Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
gfisch13
Creator II
Creator II

If condition - script issue

Hi - I'm loading data from a spreadsheet source and trying to create a field called bucket where records are classified as:

  • Under 30,
  • 31-60,
  • 61-120,
  • Greater than 120.

The attached script (to preserve color) continues to throw an error indicating the the expression is missing a ")" (closing parenthesis).  I've also listed the script below, the section in question is highlighted in orange.

I cannot seem to understand where this should be placed.  Open to any comments/suggestions.

Thanks, George

LOAD Location,
     [Case Number (Fraud ID)],
     [Date Reported],
     [Date Investigation Started],
     [Amount at Risk/Detected Fraud (USD)],
     [Subject of Investigation],
     [Case Contact],
     [Product/Claim Type],
     [Case Type],
     [Coverage Type],
     [Internal/ External],
     [Case Details],
     [Action Taken],
     [Amount of Recovered Fraud (USD)],
     [Amount of Prevented Fraud (USD)],
     [Case Investigation Status],
     [Date Investigation Closed],
     [Fraud Type],
     [Case Age (Days)],
     [Net Loss (USD)],
     [Opened Period],
     [Closed Period],
       IF ([Case Age (Days)] <= 30, Dual('Less than 30', 1),
              IF ([Case Age (Days)] => 31 and [Case Age (Days)] <= 60, Dual('30-60', 2),
              IF ([Case Age (Days)] => 61 and [Case Age (Days)] <= 120, Dual('61-120', 3),
              IF ([Case Age (Days)] => 121, Dual('Greater than 120', 4))))) as Buckets,
     Confidential
FROM

 

Labels (2)
1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

4 Replies
Chanty4u
MVP
MVP

Chanty4u
MVP
MVP

Or try to create those bucket in before load statement only ? Did you tried that ?

gfisch13
Creator II
Creator II
Author

Thank you, this is a great guide, and I also learned that I had inverted my => and should have been >=.

Appreciate the guidance.

Chanty4u
MVP
MVP

cool it worked for you 🙂