Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
MVP
MVP

left function in set analyisis

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

4 Replies
MVP
MVP

left function in set analyisis

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

left function in set analyisis

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

MVP
MVP

left function in set analyisis

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

left function in set analyisis

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

Really appreciated

Fiber-qlik

Community Browser