Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

Expression comparing the contents of two fields

Not really sure where to start with what I am trying to accomplish below. Basically I need to have an expression that evaluates the CONTRACTMONTH against the last 2 digits of the YEARMONTH...if equal then total the revenue for that month. The example result I need is at the bottom.

COMPANYSALESPERSONREVENUECONTRACTMONTHYEARMONTH
ABCSZ10001201212
ABCJK11001201212
ABCBO12001201212
ABCSZ20001201301
ABCJK21001201301
ABCBO22001201301
ABCSZ20001201302
ABCJK21001201302
ABCBO22001201302
ABCSZ30001201312
ABCJK31001201312
ABCBO31001201312
ABCSZ40001201401
ABCJK41001201401
ABCBO42001201401
ABCSZ40001201402
ABCJK41001201402
ABCBO42001201402
RESULT
COMPANYCONTRACTMONTHYEARMONTHREVENUE
ABC01201301630
ABC012014011230
2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try sum(if(right(YEARMONTH,2)=CONTRACTMONTH,REVENUE)). See attached example.


talk is cheap, supply exceeds demand
zagzebski
Creator
Creator
Author

Thanks. It is returning values but way more revenue than exists for the specific companies. I need to look at why that is happening.