Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
davidbe1
Contributor

Set Analysis

Hey There,

i try to use function on set analysis but i see i have an errors in my expression.

need some help

This is not working 

=Sum({<Left(OrderDateKey,4)={'2006'}>}SalesAmount)

This is work :

Sum({$<Year={"$(=Year(Today()))"}>}Sales)

1 Solution

Accepted Solutions
MVP
MVP

Re: Set Analysis

But you can do a search on your field values like

=Sum( {<OrderDateKey={"2006*"} >} SalesAmount)

edit:

This should also work, just for demonstration:

=Sum( OrderDateKey={"=Left(OrderDateKey,4)=2006"}>}SalesAmount)

View solution in original post

6 Replies
Highlighted

Re: Set Analysis

You are not allowed to use functions on the left hand side of the set analysis modifier and that is why the first expression isn't working.

jepeerik
New Contributor III

Re: Set Analysis

You can only compare fields (in your case Year) with values within Set Analysis.

So if you convert OrderDateKey in your script into a Year field, you'll be able to create the second proposed Set Analysis.

And for performance reasons it is also better to prepare your dimensions in the script instead of having a calculated dimension in your front-end of the dashboard.

Sharing knowledge increases your knowledge
MVP
MVP

Re: Set Analysis

1st expression:

one solution could be to add a year field in the script (maybe in a calendar),

then use this new field in set analysis

MVP
MVP

Re: Set Analysis

But you can do a search on your field values like

=Sum( {<OrderDateKey={"2006*"} >} SalesAmount)

edit:

This should also work, just for demonstration:

=Sum( OrderDateKey={"=Left(OrderDateKey,4)=2006"}>}SalesAmount)

View solution in original post

davidbe1
Contributor

Re: Set Analysis

Thank you but the second expression not working for me. i think the best way to do it is on the script

davidbe1
Contributor

Re: Set Analysis

I think about it as solution wanna be sure that is not possible Thx