
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nested IF Statements
Hello Qlik Users,
I need to have some nested if statements to turn ranges of scores into buckets.
My field is 'Total Score' and I need a bucket for scores greater than 99.99, scores between 99.99-95, and 94-90.
If some one could help with the syntax for multiple if statements that would be great.
Thanks
- Tags:
- nested if
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Please try this expression .
If( [Total Score] > 99.99, 'A',
If([Total Score] <=99.99 and [Total Score] >=95),'B',
If([Total Score] <95 and [Total Score] >=90,'C','D')))


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe something like
If( [Total Score] > 99.99, dual( '> 99.99', 100),
If([Total Score] >=95, Dual('95 - 99.99', 95),
If([Total Score] >=90 , Dual('90 - 95', 90) )
)
)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you check this, clean explanation of Bucket with multiple IF statement?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IF( Condition , True, If( Condition , True) ) Hope this helps.
vikas
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi IF(material4='TAB','TAB',IF(material4='SMP','SMP','REL')) AS REL4, bjut its working fine i need to reflet this material4 to REL4.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Please try this expression .
If( [Total Score] > 99.99, 'A',
If([Total Score] <=99.99 and [Total Score] >=95),'B',
If([Total Score] <95 and [Total Score] >=90,'C','D')))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a more efficient method to nested if statements?
In Excel VBA I would use the "Case Select" function. Is there something similar in Qlikview?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If( [Total Score] > 99.99, 'A',
If([Total Score] <=99.99 and [Total Score] >=95),'B',
If([Total Score] <95 and [Total Score] >=90,'C','D'))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How would I nest the IF statements using the following script?
IF([Expenditure Type]='FB, Classified Staff','FB',)
IF([Expenditure Type]='FB, Univ Staff,'FB',)
IF([Expenditure Type]=’Awards & Prizes (Cash)’,’Reward & Recognition’,)
IF([Expenditure Type]= 'Emp, Recognition Awrd-Non Txbl','Reward & Recognition',)
IF([Expenditure Type]= 'Employee, Recognition Awards','Reward & Recognition',)
IF([Expenditure Type]= ‘Eq Capital Network Servers’,'Hardware’,)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you have to nested if statement for this expression
if statement contains comma (,) is represented by "else" part .
In your else part put after comma.

- « Previous Replies
-
- 1
- 2
- Next Replies »