Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mutangadura
Contributor
Contributor

Qlikview equivalent of max(case...)

Hi I have data as below and would like to get it all into a single line. I have tried Max(agr) to no avail. Can someone help.

 

ABCFH
HE4545Y----
HE4545-Y---
HE4545--Y--
HE4545---Y-
HE4545----

Y

I ideally I want it in the following format.

 

ABCFH
HE4545YYYY

Y

The top one was created using an if statement based on multiple criteria that determines if there the value is to be 'Y'

The data has a date for corresponding values to A when Y is true but that might be different for B, C and so on...

6 Replies
sunny_talwar

MaxString() instead of Max?

Anil_Babu_Samineni

Where are you trying this? Front-End / Back-End ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Sergey_Shuklin
Specialist
Specialist

Hello!

I didn't sure to get you right, but, please, see the attachement. May be it's it.

mutangadura
Contributor
Contributor
Author

Hi thanks but that didn't work. I'm doing this in the back end in the load my syntanx looks like this:

IF(blah_blah = 'A' AND MATCH(yad_yah,'Y','B','1','3','5','6','7','8'),'Y',  Null()) AS 'A'

Thats based on the fact that A can take any of the values 'Y','B','1','3','5','6','7','8' so when that is the case I want it to be Y

I do this for B, C & D such that I can get the table below:

ABCFH
HE4545Y----
HE4545-Y---
HE4545--Y--
HE4545---Y-
HE4545----

Y

what I want however is as below:

ABCFH
HE4545YYYY

Y

Anil_Babu_Samineni

Can you post full code may be? Try this for once

IF(blah_blah = 'A' AND If(Index(MATCH(yad_yah,'Y','B','1','3','5','6','7','8'))>0,'Y',  Null()) AS 'A'

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
mutangadura
Contributor
Contributor
Author

Hi Anil I think your code might just do it but missing one of the brackets and having a torrid time placing it based on the logic