Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Expression

Hi,

Having the year format as in the attachment , how to fetch previous year data using the same year field in set analysis of an expression.

Thanks in advance

7 Replies
Anonymous
Not applicable
Author

hi veena

Please try:

Sum({<DATE={"$(=Date(AddYears(DATE,-1)))"}>}AMOUNT)


Digvijay_Singh

Do you mean you need to select 2010 from your year field '2010-2011'? Something like that

{<Year={$(=subfield('2010-2011','-',1)}>}

SreeniJD
Specialist
Specialist

Hi Veena

You can have two additional date columns by converting the year(which is string here) as mentioned below...

2013-2014

left(fyear,4)... which gives you 2013

right(fyear,4).. will gives you 2014

use these expresssions, in your set analysis to get the desired analysis...

If you need more help, send me your sample qvw, I will provide the solution.

Regards,

Sreeni

Kushal_Chawda

if you have calculated the YearName as yearname(Date,0,4), you can use below set expression

=sum(DISTINCT {<YearName={"$(=yearname(max(YearName)-1,0,4))"}>}Value)

Not applicable
Author

Hi Veena,

use like this:

Sum({<YEAR_FIELD_NAME={'$(=Left(YEAR_FIELD_NAME,4))'}>} SALE_AMOUNT)


Regards

Gennaro

Not applicable
Author

I got it resolved. Thanks everyone!

Digvijay_Singh

Please close the thread by marking appropriate replies answered,helpful. Thanks!