Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Logic transformation Help

Hi Guys ,

Please see into excel, Dummy data with desired output. please suggest.

Thanks in Advance

6 Replies
tresesco
MVP
MVP

Is this logic Date dependent? What if one status is red in one day and not reported in another date?

abhaysingh
Specialist II
Specialist II
Author

yes it is date dependant, if it is RED in any date against ID .i.e Primary key for that, it will be RED.

tresesco
MVP
MVP

Then I guess the expected output for C080463 in your sample file is not right. Could you please check and confirm?

vinieme12
Champion III
Champion III

Try like below

FACT:

LOAD ID,

     dual(RAGStatus,Match(RAGStatus,'Green','NotReported','Red')) as RAGStatus,

     Date,

     AutoNumber(ID&Date) as ID_DT_Grp

FROM

[Excelfilepath]

(ooxml, embedded labels, table is Sheet1);

left join(FACT)

load ID_DT_Grp, Pick(Max(RAGStatus) ,'Green','NotReported','Red') as OUTPUT

Resident FACT

Group by ID_DT_Grp;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
kavita25
Partner - Specialist
Partner - Specialist

I think there might be slight change as follows:


FACT:

LOAD ID,

dual(RAGStatus,Match(RAGStatus, 'NotReported','Green' ,'Red')) as RAGStatus,

     Date,

     AutoNumber(ID&Date) as ID_DT_Grp

FROM

[Excelfilepath]

(ooxml, embedded labels, table is Sheet1);

left join(FACT)

load ID_DT_Grp, Pick(Max(RAGStatus) , 'NotReported','Green' ,'Red') as OUTPUT

Resident FACT

Group by ID_DT_Grp;

As the above code..gives Green & not reported as Not Reported.. You want Green & Not Reported as Green.

abhaysingh
Specialist II
Specialist II
Author

I tried in this way

[Sheet1]:

LOAD [ID],

  //[F2],

  [RAGStatus],

  [Date]

// [F5],

// [Output required],

// [F7],

// [Remark]

FROM [lib://AttachedFiles/Dummy Data.xlsx]

(ooxml, embedded labels, table is Sheet1);

  left join

load [ID],

  [Date],

only(if(RAGStatus= 'Red','Red')) as test,

only(if(RAGStatus= 'Green','Green')) as test1,

only(if(RAGStatus= 'NotReported','NotReported')) as test2

Resident Sheet1 Group by [ID],[Date];

and at front end

if(not IsNull(test),test,

if(not IsNull(test1),test1,

if(not IsNull(test2),test2)))

working fine.