Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Qlikview Expression

Hi,

We are having the below condition and it need to covert to qlikview logic.

Condition:

If Payment method is AL, AY,

               If Order payment amount is greater than zero

                      If Order payment status is not completed or posted

                              If Contract status is not set to ‘O’ for transmit to Fiserv

                                    If order status in not incomplete

                                             If payment comment first 4 characters is not equal to WUS, ACCT or HOLD  

                                                            Select Payment activity_Sales

The above condition need to covert into qlikview Expression.

In the above condition bolded were the fields.

Thanks..

6 Replies
Miguel_Angel_Baeyens

In the script? In an expression? For a chart? In a text object?

QlikView syntax is quite straightforward if that is your requirement since you can nest several If() statements as it seems to be the case

nareshthavidishetty
Creator III
Creator III
Author

Hi,

I need to use this in  pivot table.

Thanks..

martynlloyd
Partner - Creator III
Partner - Creator III

Something like:

If( Wildmatch(Payment method,  'AL', 'AY'),

               If( [Order payment amount] > 0,

                      If( Wildmatch([Order payment status], 'completed', 'posted'),

                              If( [Contract status] = ‘O’ ,

                                    If( NOT [order status]='incomplete',

                                             If( NOT Wildmatch(Left([payment comment],4), 'WUS', 'ACCT', 'HOLD')),  

                                                            [Payment activity_Sales], '' )))))) as YourFieldName

Regards,

Marty.

johnw
Champion III
Champion III

Set analysis like this should perform better than a direct translation of the IFs. Set analysis can't be used to check a non-field, though, which is why there's still a single IF here. If still slow, consider adding a field like [Payment Comment First 4 Bytes] and doing set analysis on it as well. Or instead, making a [Matches All My Conditions] flag and just checking for it in set analysis. I like complexity in script rather than charts where practical. But if, say, these fields were from multiple tables, doing it in script would probably be impractical.

sum({<[Payment method]*={'AL','AY'}
,[Order payment amount]*={">0"}
,[Order payment status]-={'completed','posted'}
,[Contract status]-={'O'}
,[Order status]-={'incomplete'}>}
if(not match(left([payment comment],4),'WUS','ACCT','HOLD')
,[Payment activity_sales]))

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to write it all in Set Modifiers, I believe you can write:

[payment comment]={"=not match(left([payment comment],4),'WUS','ACCT','HOLD')"}


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

johnw
Champion III
Champion III

Doh! Must remember search expressions. Must remember search expressions. Search expressions good. Good search expressions.