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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
rajni_batra
Specialist
Specialist

Multiplication of data

i have  a table

PNR    Ticket No    Amount

1            1,2          100

2              3              100

but when i split ticket with subfield

PNR    Ticket No    Amount

1            1          100

1            2         100

2              3              100

now it gives me amount 200 for PNR 1 .. how to come out from this

11 Replies
RedSky001
Partner - Creator III
Partner - Creator III

Try this:

a:

load * Inline [PNR,    Ticket No,    Amount

"1",          "1,2","100"

"2",  "3","100"];

NoConcatenate

load PNR

,    subfield([Ticket No],',') as [Ticket No]

,    Amount / count as Amount;

load * , substringcount([Ticket No],',') + 1 as count

Resident a;

drop Table a;

kamalqlik
Partner - Specialist
Partner - Specialist

Hi Rajni ,

PFA Application.

Hope it helps you.

Regards

Kamal