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

Error during representing aggreagte sum by year using set analysis

Hi,

I am trying to achieve, sum of  "supplier Liability Amount" year by year, using "Set Analysis". In the expression tab, of a bar chart, I am using this:

sum({$<(Year([Book Date]))={'2010','2011'}>} [Supplier Liability Amt])

It is showing error, right at the beginning of the curly braces before '2010'. For this, it does not yield any result. Please find the attached, to get the location of error.
More Info:
- I am not using any dimension in the dimension tab.

- Book Date, that is used in the set analysis expression is of the format MM/DD/YYYY

Kindly help me finding where exactly I am wrong.

Thanks-

Abhishek

1 Solution

Accepted Solutions
bruno_m_santos
Partner - Creator
Partner - Creator

I suggest create a new column in script to store the year book.

You 'll gain performance also.

Bruno

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi,

  

if you writing year(Date Field) then it will write a 2010 and 2011 etc.........

we cant compare in set analysis,we we can compare in if clause like.

=sum(if(wildmatch(year(Date Field),'2010','2011'), Measure Field))

Thanks

SHAIK

Nicole-Smith

If you want to do it in set analysis:

=sum({$<[Book Date]={'=match(year([Book Date]),2010,2011)'}>} [Supplier Liability Amt])

Not applicable
Author

Hi Nicole. I tried what you said. But that's not working. It is not showing any error, but not giving any result.

Not applicable
Author

Hi Khadar. It was to be achieved using set analysis. So, today I tried to make an internal table where, while loading I already extracted year from [Book Date]. That way it left me with Year field which I could directly put into the set expression clause. Thanks.

Anonymous
Not applicable
Author

Hi,

 

if you are using year field inset analysis we can use directly in set analysis,but you are using data field,

please share before what ever the expression you are using before.


Thanks

Shaik

bruno_m_santos
Partner - Creator
Partner - Creator

I suggest create a new column in script to store the year book.

You 'll gain performance also.

Bruno