Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Populate Table Dinamically

Hi guys,

I have a table like this :

FactTab.png

A list of possible SubGroups like this :

Subgroup.png

And I'd like to populate the blank fields of the Subgroup Column with the possible Subgroup values not populated before (blank means all possible values except the ones that were previously populated). This is my desired result :

DesiredResult.png

How can I do it with Qlik? Anyone can give me some help with that?

I've attached an example here.

Regards, Marcel.

1 Solution

Accepted Solutions
maxgro
MVP
MVP


1.png


Tmp:

load distinct Year, Month, Group, Reference

FROM Example.xlsx (ooxml, embedded labels, table is Hoja1);

join(Tmp)

LOAD SubGroup

FROM Example.xlsx (ooxml, embedded labels, table is Hoja2);

left join (Tmp)

load Year, Month, Group, Reference, SubGroup, Amount

FROM Example.xlsx (ooxml, embedded labels, table is Hoja1);

left join (Tmp)

load Year, Month, Group, Reference, Amount as Amount2

FROM Example.xlsx (ooxml, embedded labels, table is Hoja1)

where len(trim(SubGroup))=0;

Final:

load Year, Month, Group, SubGroup, Reference, alt(Amount, Amount2) as Amount

Resident Tmp;

DROP Table Tmp;

View solution in original post

2 Replies
maxgro
MVP
MVP


1.png


Tmp:

load distinct Year, Month, Group, Reference

FROM Example.xlsx (ooxml, embedded labels, table is Hoja1);

join(Tmp)

LOAD SubGroup

FROM Example.xlsx (ooxml, embedded labels, table is Hoja2);

left join (Tmp)

load Year, Month, Group, Reference, SubGroup, Amount

FROM Example.xlsx (ooxml, embedded labels, table is Hoja1);

left join (Tmp)

load Year, Month, Group, Reference, Amount as Amount2

FROM Example.xlsx (ooxml, embedded labels, table is Hoja1)

where len(trim(SubGroup))=0;

Final:

load Year, Month, Group, SubGroup, Reference, alt(Amount, Amount2) as Amount

Resident Tmp;

DROP Table Tmp;

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thanks Maxgro! It works like a charm.

Regards, Marcel.