Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Insert a separate row on Condition

Hi,

I am unable to achieve the following in a Qlikview report.

I have the date as following:

   

IDProvided ToCustomer NamePartner Name
1CustomerJohnMel
2PartnerStuartJessy
3BothDavidSue
4BothJosh

Cathey

And I need to populate as following: If the 'Provided To' is for 'Both' then a separate record should be inserted for the Customer and Partner. Please help.

   

IDProvided ToCustomer Name
1CustomerJohn
2PartnerStuart
3BothDavid
3BothSue
4BothJosh
4BothCathey
1 Reply
qliksus
Specialist II
Specialist II

Maybe something like this

load
ID,
[Provided To],
SubField(Customername,'-') as Customername ;

LOAD ID,[Provided To] ,if([Provided To]='Both', Customer&'-'&Partner , Customer) as Customername INLINE [   
    ID, Provided To, Customer, Partner
    1, Customer, John, Mel
    2, Partner, Stuart, Jessy
    3, Both, David, Sue
    4, Both, Josh, Cathey
];