Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

zagzebski
Contributor

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

Re: Expression comparing the contents of two fields

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


talk is cheap, supply exceeds demand
zagzebski
Contributor

Re: Expression comparing the contents of two fields

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

Community Browser