Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Create a flag

Hi,

I have tried in different ways but not with good result. Therefore I turn to the combined wisdom of community...

I have a table with visitors:

Visitors:
LOAD
            Left(Filename(), 3) as Omr,
(Filename()) as Reg,
            RecNo() as %Index,
            Patindex,
            Left(FileName(), 3) & '_' & Patindex as %IndexPnr,
            Left(FileName(), 3) & '_' & Patindex as %IndexPnrTest,
            VisitingDate,
            Left(FileName(), 3) & '_' & Patindex & '_' & VisitingDate as %IndexPnrBD,
            Year(MakeDate(Left(Besöksdatum, 4), Mid(VisitingDate, 5, 2), Mid(VisitingDate, 7, 2))) as År,
            Month(MakeDate(Left(Besöksdatum, 4), Mid(VisitingDate, 5, 2), Mid(VisitingDate, 7, 2))) as Månad,
            Day(MakeDate(Left(Besöksdatum, 4), Mid(VisitingDate, 5, 2), Mid(VisitingDate, 7, 2))) as Dag,
            WeekDay(MakeDate(Left(Besöksdatum, 4),          Mid(VisitingDate, 5, 2), Mid(VisitingDate, 7, 2))) as VeckoDag,
            If(Day(MakeDate(Left(Besöksdatum, 4), Mid(VisitingDate, 5, 2), Mid(VisitingDate, 7, 2))) = 25, 'Journal per 25:e') as Info,
     Signatur,
     Journal  as VG,  

%Index is unique for every visitor. But every visitor can appear multiple time in table. What's the best way to create a flag to be able to sum every unique visit with the same result as Count(DISTINCT %Index)?

Best regards

Torbjörn Ungvall (@Ungvall)

Senior Business Discovery Manager

Advectas AB

Tags (1)
1 Solution

Accepted Solutions
frank_carlsson
New Contributor II

Re: Create a flag

Hi!

Is this what you're looking for?

4 Replies
Not applicable

Re: Create a flag

Hi Torbjörn,

could you give an example: Input (maybe a bit simplified) and expected output?

Ciao

Klaus

Not applicable

Re: Create a flag

Thanks,

Uploaded a scrambled file. Sum(Flag) have to be same as Count(DISTINCT %Index)

Best regards

Torbjörn Ungvall (@Ungvall)

Senior Business Discovery Manager

Advectas AB

frank_carlsson
New Contributor II

Re: Create a flag

Hi!

Is this what you're looking for?

MVP
MVP

Re: Create a flag

You could use exists() and dump the order by %Index..

- Ralf

Community Browser