Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

if match condition help

Hi Experts,

Can any one please help me on below requirement.

I have to create one new field  from below mentioned 4 fields (Entity, Feedback, Start date and end date ) named [T/N Product] with 2 records i.e., Trending Product and Non Trending Product records

based on existing fields condition using if match expression.

Conditions:

if  Entity  = Sales then Trending Product

if  Entity  = Manager then Non Trending Product but only if Feedback = Yes else Trending Product

If  Entity  = Products  then Non Trending Product but only if Feedback =No  and (End date -start date)<=3years

if  Entity  = Rating then Trending Product

if any new field added at Entity it has to be treated as Trending Product

Entity            Feedback          Start date            end date

Sales                Yes                  01/02/2015          05/01/2018

Manger            No                    01/02/2017          05/01/2018

Products                                    01/02/2017          05/01/2018

Rating

Please help me on this.

Thanks in advance.

1 Solution

Accepted Solutions
Highlighted
Creator III
Creator III

I suspect the Entity field values may contain extra spaces...

Try this version

If(Match(Trim(Entity), 'Sales', 'Rating'), 'Trending Product',

    If(

          (Trim(Entity) = 'Manager' and Feedback = 'Yes') or (Trim(Entity) = 'Products' and Feedback = 'No' and (Year(End Date)-Year(Start Date)) <=3) or (Match(Trim(Entity),'Testing','Production')),

          'Non Trending Product',

          'Trending Product'

          )

)

Father/Husband/BI Developer

View solution in original post

10 Replies
Highlighted
Creator III
Creator III

There you are....

if(Match(Entity,'Sales','Rating'),

     'Trending Product',

     if((Entity='Manager' and Feedback='Yes') or (Entity='Products' and Feedback='No' and (Year(End Date)-Year(Start Date))<=3),

          'Non Trending Product'),

          'Trending Product'

          )

)

Father/Husband/BI Developer
Highlighted
Creator II
Creator II

Hi,

Could you please help me on this.

stalwar1

jyothish8807

Highlighted
Creator III
Creator III

There it is

if(Match(Entity,'Sales','Rating'),

    'Trending Product',

    if((Entity='Manager' and Feedback='Yes') or (Entity='Products' and Feedback='No' and (Year(End Date)-Year(Start Date))<=3 or Match(Entity,'Testing','Production')),

          'Non Trending Product'),

          'Trending Product'

          )

)

Father/Husband/BI Developer
Highlighted
Creator II
Creator II

Hi,

Thanks for your help. But I am getting error in expression.

Highlighted
Creator III
Creator III

Paste your expression here

Father/Husband/BI Developer
Highlighted

Corrected some parenthesis

If(Match(Entity, 'Sales', 'Rating'), 'Trending Product',

    If(

          (Entity = 'Manager' and Feedback = 'Yes') or (Entity = 'Products' and Feedback = 'No' and (Year(End Date)-Year(Start Date)) <=3) or (Match(Entity,'Testing','Production')),

          'Non Trending Product',

          'Trending Product'

          )

)

Highlighted
Creator II
Creator II

HI Sunny,

Now the error removed but expression not working.

By filtering Entity='Testing' not getting 'Non Trending Product' in the new field.


Thanks in advacne

Highlighted

Can you share an image of a table box where you add Entity, Feedback, EndDate, StartDate and this new expression as dimensions?

Highlighted
Creator III
Creator III

I suspect the Entity field values may contain extra spaces...

Try this version

If(Match(Trim(Entity), 'Sales', 'Rating'), 'Trending Product',

    If(

          (Trim(Entity) = 'Manager' and Feedback = 'Yes') or (Trim(Entity) = 'Products' and Feedback = 'No' and (Year(End Date)-Year(Start Date)) <=3) or (Match(Trim(Entity),'Testing','Production')),

          'Non Trending Product',

          'Trending Product'

          )

)

Father/Husband/BI Developer

View solution in original post