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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
tamilarasu
Champion
Champion

MaxString is not working in advanced set analysis

Hi All,

I have below MaxString expression which is working fine for each line.

= Maxstring( {< %BILLINGDOC=, KONV.KSCHL={'ZVSH'} >} KONV.KNUMH) 

Now, I have to find max KNUMH value (for that I used above maxstring  function) and sum up the respective KBETR values for each MEL numbers. So, I am trying to apply the same in advance set analysis which is not working.

= Sum (  {<


KONV.KNUMH={"= Maxstring( {< %BILLINGDOC= ,KONV.KSCHL={'ZVSH'}>} KONV.KNUMH)" }

         >}


KONV.KBETR)


In my case it should show 0 i.e KBETR is 0 for for the KNUMH - 0322567585.


I think Maxstring function is not working in advanced set analysis. Any help or guidance is appreciated.

Capture.PNG

Note:  Please do not ask me to upload the application which is not possible,

Edit: I have uploaded sample document

20 Replies
tamilarasu
Champion
Champion
Author

My mistake. Sample is working as expected. Unfortunately, the below one is returning the same result as above. I am just trying to play with your expression.

=FirstSortedValue({<%BILLINGDOC= ,KONV.KSCHL={'ZVSH'}>} Aggr(Sum({<%BILLINGDOC= ,KONV.KSCHL={'ZVSH'}>} KONV.KBETR), MARA_ENHANCED.NORMT, KONV.KNUMH), -Aggr(Rank(KONV.KNUMH), MARA_ENHANCED.NORMT, KONV.KNUMH))

Capture.PNG

sunny_talwar

Can you create a new table like this

Dimensions

MARA_ENHANCED.NORMT

KONV.KNUMH


Expression

Sum({<%BILLINGDOC= ,KONV.KSCHL = {'ZVSH'}>} KONV.KBETR)

and share a screenshot

andrey_krylov
Specialist
Specialist

Finally I understood what you want, after Sunny has put her solution) And here is another way

Sum(If(Cond = Aggr(Max(TOTAL<MEL>Cond), MEL, Cond), Sales, 0))

tamilarasu
Champion
Champion
Author

Here is the screenshot.

Capture.PNG

sunny_talwar

I wonder why 0322567585 isn't showing up within KONV.KNUMH? How about if you add this as a second expression

Sum({<%BILLINGDOC>} KONV.KBETR)

tamilarasu
Champion
Champion
Author

Yeah.

Capture.PNG

tamilarasu
Champion
Champion
Author

Sample file is working fine but when I applied the same in my application it is not working.

tamilarasu
Champion
Champion
Author

Sorry Guys. I would like to attach my file but I am not supposed to do it.

sunny_talwar

This is strange, I am confused as to why 0322567585 isn't showing up? Does it have a zero value for Sum({<%BILLINGDOC>} KONV.KBETR)

tamilarasu
Champion
Champion
Author

I was hurry so sorry for the confusion. Yes it is zero value (I have already mentioned in the question).