# Qlik Sense App Development

Valued Contributor

## MoM and YTD Trend..

Hi..

I want to show below expression in line chart...

sum({<Val_Date={">=\$(vValStart)<=\$(vValEnd)"}>}if(vCalCurrentDate< Val_Date,[Net Tractor Revenue (Domestic)]))

/

sum( {<Link_Date={">=\$(vCalMinDate)<=\$(vCalCurrentDate)"}>} [Net Tractor Revenue (Domestic)])

Regards,

Kavita

16 Replies
MVP

## Re: MoM and YTD Trend..

When you say line chat...

1) What are the dimension(s) you are going to use in Line Chart?

2) What exactly the logic behind this expression?

Regards,

MK

Valued Contributor

## Re: MoM and YTD Trend..

My calendar is not linked with the data..

The logic is..

I want to calculate those revenue..whose validity date falls under this year... divided by total revenue..which is calculated on the basis of another field..

I have attached sample app..kindly look into it..

MVP

## Re: MoM and YTD Trend..

What are the dimension(s) you are going to use for Line Chart?

Valued Contributor

## Re: MoM and YTD Trend..

Yes, Please specify the dimension names in line chart

MVP

## Re: MoM and YTD Trend..

I guess a lot of people before me have asked the same question about what is the dimension here. I would like to additionally ask you about what is the expected output in terms of numbers you want to see for each month and probably break it down in terms of number in the numerator and number in denominator. The more info you can provide, the easier it will be for us to play around in your sample because those are things we don't know.

Best,

Sunny

Valued Contributor

## Re: MoM and YTD Trend..

Hi..I want to show Month Wise trend..

But my calendar is not linked with the data..

I have two dates Link_Date and Val_Date from data and LinkDate is from Calendar.

The calculation is...sum of revenue with the Val_Date divided by sum revenue with the Link_Date.

My filters are from Calendar.

I hope now u understand it better...

Kindly look into it.

Regards,

Kavita

Valued Contributor

## Re: MoM and YTD Trend..

PFA of the output...

Regards,

Kavita

MVP

## Re: MoM and YTD Trend..

I think you cannot use set analysis in your denominator because you are hoping to get it evaluated based on your dimension and set analysis is evaluated only once per chart. The expression which is working is very slow (at least for the sample), but you can give it a try

=Num(Sum({<Val_Date={">=\$(vValStart)<=\$(vValEnd)"}>} If(vCalCurrentDate < Val_Date,[Net Tractor Revenue (Domestic)]))

/

Valued Contributor

## Re: MoM and YTD Trend..

Thank You Sunny..

MoM Is done..But how Can I show YTD or QTD.. with the same expression...

For e.g

YTD: If is Select Jul then it should show Apr to Jul.

QTD:If is Select Jul then it should show only Jul.

Regards,

Kavita