Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

tkjenkin
New Contributor

I am trying to write two conditions in an IF statement

I am trying to see if a Prime Name or relationship to a Master Name changes.

Below is the data:

   

DatePrime CodePrime NamePrime CityPrime StateMaster CodeMaster NameBroker Name
Dec-16abcdAon ChicagoChicago Illinoisefghefghefgh
Dec-15abcdAon ChicagoChicago Illinoisefghefghefgh
Dec-14abcdAon ChicagoChicago Illinoisijklijklijkl

Here is what I want to see:  For Dec 2016, the names stayed the same so the result is True, For Dec 2015 the names stayed the same so the results are still True, but in Dec 2014, the Master Name, Code and Broker Name changed so the result is changed to False.

I tried something like this but it didn't work:  =IF(([Business Cycle Dt] = Max([Business Cycle Dt]) and [Business Cycle Dt] = '2016-12-31') and ([Prime_Producer_Name]=[Prime_Producer_Name])),'True', 'False'

   

as of Dec 2016as of Dec 2015as of Dec 2014
Prime CodePrime NamePrime CityPrime StateMaster CodeMaster NameBroker NameCYTD (2017)WPMaster AsscociationWPMaster AsscociationWPMaster AsscociationWP
abcdAon ChicagoChicago IllinoisefghAon MidwestAon1000TRUE1200TRUE900FALSE1300

   

4 Replies
laddu_927
Valued Contributor

Re: I am trying to write two conditions in an IF statement

You need to compare in a table or script??

hector_munoz
Valued Contributor

Re: I am trying to write two conditions in an IF statement

Hi,

You could do it in script if all the fields reside in the same table, first ordering by 'Prime Code' ASC, Date DESC, for example and later using Previous() function in order to detect if the same values are in the fields of the record of the following year.

I hope it helps you!

Regards,

H

tkjenkin
New Contributor

Re: I am trying to write two conditions in an IF statement

In a table

tkjenkin
New Contributor

Re: I am trying to write two conditions in an IF statement

like this.  where it is true that is where the names didn't change.

   

   

as of Dec 2016as of Dec 2015as of Dec 2014
Master AsscociationWPMaster AsscociationWPMaster AsscociationWP
TRUE1200TRUE900FALSE1300