
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your answers. I´ll see what I can find in that section.
Really appreciated
Fiber-qlik
