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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
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
sujeetsingh
Master III
Master III

Please give a sample or explain your all scenario

rajni_batra
Specialist
Specialist
Author

i just wanted to split comma separed values into diff no of rows which is done but my amount is getting multiplied how to avoid that is my question

rajni_batra
Specialist
Specialist
Author

i just wanted to split comma separed values into diff no of rows which is done but my amount is getting multiplied how to avoid that is my question

Or
MVP
MVP

What should be happening to your total? Should the 100 be associated only with the first row? Should it be split across all rows (in this example, 50 each)? Should each row have 100 associated with it, but when totalling, only unique PNRs are totaled?

rajni_batra
Specialist
Specialist
Author

sum(Amount) should be 100 only

PNR     Ticket   amount

1          1          100

1           2          100

Total               100

rajni_batra
Specialist
Specialist
Author

sum(Amount) should be 100 only

PNR     Ticket   amount

1          1          100

1           2          100

Total               100

Not applicable

Try

Sum(Amount)/Sum(PNR)

By

Rebeca

rajni_batra
Specialist
Specialist
Author

no

Or
MVP
MVP

Actually, that should be sum(Amount) / count(PNR). Depending on the specific data model, this may not work well (if PNR is a key). If that's the case, you may have to bring in a second instance of PNR  just so you can use count() on it without problems.