Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
rachanajannapur
New Contributor II

Calculations of YTD

input fields:

   

Country15-Jan15-Feb16-Jan16-Feb
UK100200500600
India245254550650

I have the fileds like above and I need to out put like below , please help me to get the below result:

  Output:  

Country15-Jan15-Feb16-Jan16-Feb
UK1003005001100
India2454995501200
4 Replies
boraste-sagar
New Contributor III

Re: Calculations of YTD

Hi Rachana,

You can use the concept of running total in the expressions to add the total of previous month t=with current month using expressions

for your output of 15-Feb use this expression

=Sum([15-Jan])+Sum([15-Feb])

same for 16-Feb and so on

=sum([16-Jan])+Sum([16-Feb])Solution.png

priyalvp24
Contributor

Re: Calculations of YTD

hi,

Try this

At Script Level:

num(Month(datefield)) as DocMonth,

Year(datefield) as DocYear

At Front.

Country as Dimension.

In measure write below set analysis

sum({<DocMonth={"$(=max({<DocYear={'$(=max(DocYear))'}>}DocMonth))"}>}     [Measure Field])

Thanks,

Priyal

balabhaskarqlik
Honored Contributor

Re: Calculations of YTD

Try this:

RangeSum( Before(TOTAL Sum(Sales),0,ColumnNo(TOTAL)))

balabhaskarqlik
Honored Contributor

Re: Calculations of YTD