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: 
Anonymous
Not applicable

Trellis Chart

I have a trellis chart with Sum(Amount) which represents yearly sales as an expression.  The application is attached. 

I using the following expression to calculate the MAT for each applicant:

if(Year = 2015,Num(sum({<[Date Dispensed]={">=$(=addmonths(MonthEnd(max([Date Dispensed]))+1,-12)) <=$(=max([Date Dispensed]))"}, Applicant = {[SANOFI AVENTIS], GLAXOSMITHKLINE, PFIZER, NOVARTIS, [TORRENT],[NOVO NORDISK], RANBAXY, IPCA, ALCON, GLENMARK, MYLAN, VARICHEM, [CIPLA], ALLERGAN}>}[MedAid Amount]+Shortfall), '$##,##0.00'), if(Year = 2014, Num(sum({<[Date Dispensed]={">=$(=addmonths(MonthEnd(max([Date Dispensed]),)+1,-24)) <=$(=addmonths(MonthEnd(max([Date Dispensed])),-12))"}, Applicant = {[SANOFI AVENTIS], GLAXOSMITHKLINE, PFIZER, NOVARTIS, TORRENT,[NOVO NORDISK], RANBAXY, IPCA, ALCON, GLENMARK, MYLAN, VARICHEM, [CIPLA], ALLERGAN}>}[MedAid Amount]+Shortfall), '$##,##0.00'), if(Year = 2013, Num(sum({<[Date Dispensed]={">=$(=addmonths(MonthEnd(max([Date Dispensed]),)+1,-36)) <=$(=addmonths(MonthEnd(max([Date Dispensed])),-24))"}, Applicant = {[SANOFI AVENTIS], GLAXOSMITHKLINE, PFIZER, NOVARTIS, TORRENT,[NOVO NORDISK], RANBAXY, IPCA, ALCON, GLENMARK, MYLAN, VARICHEM, [CIPLA], ALLERGAN}>}[MedAid Amount]+Shortfall), '$##,##0.00'))))


I am getting some results which are however lower than expected.  Can any one look at the above expression and application and advise accordingly.

Message was edited by: Christopher Chitemerere

5 Replies
Marcio_Campestrini
Specialist
Specialist

Hi Christopher

Try to break your expression in small expressions to identifiy what is the result in each step. This works for me when I have a situation like yours.


Marcio

Márcio Rodrigo Campestrini
Anonymous
Not applicable
Author

Many thanks Marcio

Marcio_Campestrini
Specialist
Specialist

Hi

Have you solved your problem? If you did, please choose the correct answer and help us to keep community focused.

Márcio Rodrigo Campestrini
Anil_Babu_Samineni

If you have forecast data then how you are calculating the CU, LY & LLY. I recommend you to create aggression functions and it send ok to me. What was the issue you are facing? Is there Any typo error because I don't have license for local client

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Marcio_Campestrini
Specialist
Specialist

Got you issue solved? Please mark helpful/correct answers.

Márcio Rodrigo Campestrini