# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Valued Contributor II

## SET Expression for getting Jan 2016 amount ?

Hi All

I have below expression will return CYTD ( Jan and Feb ) amount , is working fine :-

money(

sum({\$<year = {\$(=max(year))}, month = {"<=\$(=max({<year={\$(=max(year))}>} month))"}>} \$(ColumnDim51)/\$(Columndim89)/1000)

, \$(vMoneyFormatK))

May i know how to modify the above expression , so that it will return CY ( Jan ) Amount ?

Paul

1 Solution

Accepted Solutions
MVP

## Re: SET Expression for getting Jan 2016 amount ?

Seems like Feb's sum is equal to 0 and hence this below formula would show the same number for Jan as it was showing for Jan and Feb. But if there was some data for Feb, then the below expression will work:

money(

sum({\$<year = {\$(=max(year))}, month = {"\$(=max({<year={\$(=max(year))}>} month)-1)"}>} \$(ColumnDim51)/\$(Columndim89)/1000)

, \$(vMoneyFormatK))

5 Replies
MVP

## Re: SET Expression for getting Jan 2016 amount ?

Seems like Feb's sum is equal to 0 and hence this below formula would show the same number for Jan as it was showing for Jan and Feb. But if there was some data for Feb, then the below expression will work:

money(

sum({\$<year = {\$(=max(year))}, month = {"\$(=max({<year={\$(=max(year))}>} month)-1)"}>} \$(ColumnDim51)/\$(Columndim89)/1000)

, \$(vMoneyFormatK))

Valued Contributor II

## Re: SET Expression for getting Jan 2016 amount ?

Hi Sunny

Thank you vey much , your above exmpression is working fine .

Same as above , i hope you can help me modify the below expression , to display Last year Jan 2016 Amount:-

money(

sum({\$<year = {\$(=max(year)-1)}, month = {"<=\$(=max({<year={\$(=max(year))}>} month))"}>}\$(ColumnDim51)/\$(Columndim89)/1000)

, \$(vMoneyFormatK))

Paul

MVP

## Re: SET Expression for getting Jan 2016 amount ?

Try this:

Money(

Sum({\$<year = {\$(=max(year)-1)}, month = {"\$(=max({<year={\$(=max(year))}>} month)-1)"}>} \$(ColumnDim51)/\$(Columndim89)/1000)

, \$(vMoneyFormatK))

Valued Contributor II

## Re: SET Expression for getting Jan 2016 amount ?

Hi Sunny

Thank you very much for your help , it work.

Paul

MVP

Awesome