Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

load

Hi Everyone

I have the following load statement:

SQL SELECT "job_nummer",

    jobnr,

    "datum_auftrag",

    Year ("datum_auftrag") as Jahr,

    Month ("datum_auftrag") as Monat,

    jobkategorie

FROM EASY.job where "datum_auftrag" is not null;

I would like to generate a new field called "Gesellschaft" that contains characerts 11-12 from all entries in "job_nummer".

Could somebody give me advise how to script this?

Thank you very much for your help!

1 Solution

Accepted Solutions
marcus_malinow
Valued Contributor III

Re: load

Hi Jan,

use the Mid function.

LOAD *,

       mid(job_nummer, 11,2) as Gesellschaft;

SQL SELECT [the rest of your SQL]

Marcus

6 Replies
jebamalai
Valued Contributor

Re: load

How do you want to read the characters from Left or Right,

You can try like below

left(job_nummer,12) as Gesellschaft

or send me the conditions

anbu1984
Honored Contributor III

Re: load

In Oracle you can use SUBSTR

SQL SELECT "job_nummer",

    jobnr,

    "datum_auftrag",

    Year ("datum_auftrag") as Jahr,

    Month ("datum_auftrag") as Monat,

    jobkategorie,

    SUBSTR(job_nummer,11,2) As Gesellschaft

FROM EASY.job where "datum_auftrag" is not null;

In qlikview

Mid(job_nummer,11,2)

marcus_malinow
Valued Contributor III

Re: load

Hi Jan,

use the Mid function.

LOAD *,

       mid(job_nummer, 11,2) as Gesellschaft;

SQL SELECT [the rest of your SQL]

Marcus

Re: load

Hi try below

Load "job_nummer",

      jobnr

     "datum_auftrag"

      Year ("datum_auftrag") as Jahr,

  mid("job_nummer",11,2) as "Gesellschaft",

     Month ("datum_auftrag") as Monat;

SQL SELECT "job_nummer",

    jobnr,

    "datum_auftrag",

        jobkategorie

FROM EASY.job where "datum_auftrag" is not null;

Regards

ASHFAQ

Not applicable

Re: load

It is a Pervasive database. I would like to read out only characters 11 and 12.

Not applicable

Re: load

Thanks Marcus. Works!