Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
pra_kale
Creator III
Creator III

How to get only one value in one column

Hi,

I have attached one sample application in that SumAssured is repeated. How i can get output as per below given format. Means only one SumAssured in front of PolicyNumber.

Please help..

Thanks in Advance.

  

PolicyNumberLivesPremiumSum_Assured
123456A1235000500000
123456A12223000
123456A12445000
461234B1234500100000
461234B1321234
32456AA125600012000
654133BA113200090000
654133BA1265000
1 Solution

Accepted Solutions
sunny_talwar

Try this:

A:

LOAD PolicyNumber,

    Lives,

    Premium,

    Sum_Assured

FROM

[Policy_SA.xlsx]

(ooxml, embedded labels, table is Sheet1);

FinalA:

NoConcatenate

LOAD PolicyNumber,

    Lives,

    Premium,

    If(PolicyNumber <> Previous(PolicyNumber) and Lives <> Previous(Lives), Sum_Assured) as Sum_Assured

Resident A

Order By PolicyNumber, Lives;

DROP Table A;

View solution in original post

6 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

Please see below:

Capture.PNG

I used the below expression in a straight table:

Capture.PNG

Hope this helps.

Thanks

trdandamudi
Master II
Master II

You can also use the below expression for Sum_Assured:

Aggr(Max(Sum_Assured), PolicyNumber)

sunny_talwar

You can further make null symbol to be empty space, in case you don't want to see '-'. This is just for enhancement purposes, but I think sinanozdemir‌ and trdandamudi‌ have banged your requirement

Capture.PNG

pra_kale
Creator III
Creator III
Author

Thanks Sunny,Sinan and Thirumala for your help..

But i want same thing to be done through script, as i am going to use this data for further calculation and data size is also large so through script only i am going to export the final output in .csv file.

Whether it is possible...

Thanks in advance.

sunny_talwar

Try this:

A:

LOAD PolicyNumber,

    Lives,

    Premium,

    Sum_Assured

FROM

[Policy_SA.xlsx]

(ooxml, embedded labels, table is Sheet1);

FinalA:

NoConcatenate

LOAD PolicyNumber,

    Lives,

    Premium,

    If(PolicyNumber <> Previous(PolicyNumber) and Lives <> Previous(Lives), Sum_Assured) as Sum_Assured

Resident A

Order By PolicyNumber, Lives;

DROP Table A;

pra_kale
Creator III
Creator III
Author

Thanks Sunny...It is working.

Just want to ask one thing, the way you did in script If(PolicyNumber <> Previous(PolicyNumber) and Lives <> Previous(Lives). But, if i am having more than 15 or 20 columns then whether i have to mentioned each and every column the way you did  or any other option is available.

Thanks once again.