Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

left function in set analyisis

Good morning everybody,

yesterday a top 10 member explain me how to create a conditional SUM using set analysis expresion. But today another problem comes to my mind when I wrote this code in text object properties - general tab:

Right sentence:

=SUM({$<ACCOUNT={6400000000}, COMPANY={3003}, YEAR={"$(=ONLY(YEAR))"}, NOM_ABR={"$(=ONLY(NOM_ABR))"}>}IMPORT):

Wrong sentece:

=SUM({$<Left(ACCOUNT,2)={64}, COMPANY={3003}, YEAR={"$(=ONLY(YEAR))"}, NOM_ABR={"$(=ONLY(NOM_ABR))"}>}IMPORT)

In first case, data result is ok but I´m only choosing one account data. It was first step I want to write to validate my sentence, but when I expand it with LEFT function to take a range I really want, something is wrong and it doesn´t work.

Anyone can tell me what´s wrong?

Thanks a lot, Fiber-qlik

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello,

That's correct, in the left part only fieldnames are allowed. But you may use this to work around (untested):

=SUM({$<ACCOUNT={"=LEFT(ACCOUNT, 2) = 64"}, COMPANY={3003}, YEAR={"$(=ONLY(YEAR))"}, NOM_ABR={"$(=ONLY(NOM_ABR))"}>}IMPORT)


Hope that helps

View solution in original post

4 Replies
Miguel_Angel_Baeyens

Hello,

That's correct, in the left part only fieldnames are allowed. But you may use this to work around (untested):

=SUM({$<ACCOUNT={"=LEFT(ACCOUNT, 2) = 64"}, COMPANY={3003}, YEAR={"$(=ONLY(YEAR))"}, NOM_ABR={"$(=ONLY(NOM_ABR))"}>}IMPORT)


Hope that helps

Not applicable
Author

Perfect! It works, but I must pay attention to this language. It´s quite different to excel and access formulas. Any suggestion to improve faster my beginner knowledge? (apart from practice)

Thanks a lot!

Fiber-qlik

Miguel_Angel_Baeyens

Hi,

There are very good sample codes in this forum and in the "Share QlikViews" section where you can finde some other people's code and solutions to problems that may be very similar to yours. Just a query on Google for

set analysis site:qlik.com

will return a lot of posts, wikis and qvw files with those examples.

Apart from asking in this same forum, of course.

Regards.

Not applicable
Author

Thank you for your answers. I´ll see what I can find in that section.

Really appreciated

Fiber-qlik