Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
nihhalmca
Specialist II
Specialist II

Extract data from data by conditionally

Hi All,

Please have a look at attachment for details.

Thanks,

Nihhal.

Labels (1)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

1.png

S:

LOAD PatID,     Code,      Date

FROM [Source.xlsx] (ooxml, embedded labels, table is DB);

S1:

NoConcatenate

load PatID, Code, Date as EndDate

Resident S

Where PatID <> Peek('PatID')

order by PatID, Code desc;

left join (S1)

load PatID, Code +3 as Code, Date as StartDate

Resident S;

DROP Table S;

View solution in original post

4 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi Nihhal,

May be as at attached file.

Regards,

Andrey

vinieme12
Champion III
Champion III

do you already have a flag that specifies start and end date?then just use

Max({<Dateflag={'StartDate'}) Date) for StartDate

and Max({<Dateflag={'EndDate'}) Date) for EndDate

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
nihhalmca
Specialist II
Specialist II
Author

Hi Andrey,

Thanks for your attachment.

Actually i have to give logic while extracting data from table (edit script) instead of UI.

I need to extract only required records from data source (latest startdate and enddate per each patid) instead of all records.

maxgro
MVP
MVP

1.png

S:

LOAD PatID,     Code,      Date

FROM [Source.xlsx] (ooxml, embedded labels, table is DB);

S1:

NoConcatenate

load PatID, Code, Date as EndDate

Resident S

Where PatID <> Peek('PatID')

order by PatID, Code desc;

left join (S1)

load PatID, Code +3 as Code, Date as StartDate

Resident S;

DROP Table S;