Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ![]()
Please give a sample or explain your all scenario
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
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
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?
sum(Amount) should be 100 only
PNR Ticket amount
1 1 100
1 2 100
Total 100
sum(Amount) should be 100 only
PNR Ticket amount
1 1 100
1 2 100
Total 100
Try
Sum(Amount)/Sum(PNR)
By
Rebeca
no ![]()
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.