Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
Partner
Partner

Fractile function does not work on Qlikview server 12

I have used following function in a qlikview dashboard which works fine in Qlikview Desktop 12, but when I publish it in the server I can only get a '-' for the fractile value.

=Fractile(Aggr((Sum(Charge)/Count(DISTINCT TicketNumber)),Resource),0.9)

Is it some compatibility issue in Qlikview server version 12?

Data set looks like this.  

TicketNumber Charge Resource
125$                    10.00A
125$                    15.00A
125$                    20.00A
130$                    25.00B
135$                    25.00C
140$                    45.00A

I'm trying to get average charge amount per ticket no for each Resource and get 90th percentile of that average (when grouped by Resource)

1 Solution

Accepted Solutions
Partner
Partner

Re: Fractile function does not work on Qlikview server 12

Thank you Toni,

I did the trouble shooting like that and identified that it's a issue with Aggr() .

As per the previous trouble shoot

Concat(Aggr((Sum(charge)/Count(DISTINCT TicketNumber)),Resource),',')

did not work on the server published version.


So I aggregated the numerator and denominator separately with concat().. 

And it works

In Qlikview server 12 (published version)

1.PNG

So the solution:

Aggr(Sum(charge),Resource) / Aggr(Count(DISTINCT TicketNumber),Resource) works fine in the Qlikvew server 12 published dashboard, but Aggr((Sum(charge)/Count(DISTINCT TicketNumber)),Resource) does not work.

2.PNG

View solution in original post

5 Replies

Re: Fractile function does not work on Qlikview server 12

Just try again and see luck.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Employee
Employee

Re: Fractile function does not work on Qlikview server 12

More likely the data in your aggregation is different when you run the app on server side. Are you perhaps using Section Access causing a reduction on server?

For troubleshooting start by validating that each component in your expression returns the values that you expect.

Concatenate the Aggr() result to confirm the result are as expected; Concat(Aggr((Sum(charge)/Count(DISTINCT TicketNumber)),Resource),',')


Partner
Partner

Re: Fractile function does not work on Qlikview server 12

Thank you for your suggestion to use concat. Following is the result.

Left side 2 text boxes have my original Fractile function. Right side box has the Concat function as you mentioned.

When opened in Qlikview Desktop V12:

Capture.PNG

How published version looks like in Qlikview server 12. (Opened in Google chrome)

Capture1.PNG

Seems like a issue in Aggr() function. But both of these files has the same data set.

There's no section access on this document.

Employee
Employee

Re: Fractile function does not work on Qlikview server 12

Troubleshooting of Aggr() is done by setting up a straight table to mimic the aggregation. In your case it would be as below.

Dimension: Resource

Expression: Sum(Charge)/Count(DISTINCT TicketNumber)

With two components in the expression, you might need to split the expression into two.

Dimension: Resource

Expression1: Sum(Charge)

Expression2: Count(DISTINCT TicketNumber)


Partner
Partner

Re: Fractile function does not work on Qlikview server 12

Thank you Toni,

I did the trouble shooting like that and identified that it's a issue with Aggr() .

As per the previous trouble shoot

Concat(Aggr((Sum(charge)/Count(DISTINCT TicketNumber)),Resource),',')

did not work on the server published version.


So I aggregated the numerator and denominator separately with concat().. 

And it works

In Qlikview server 12 (published version)

1.PNG

So the solution:

Aggr(Sum(charge),Resource) / Aggr(Count(DISTINCT TicketNumber),Resource) works fine in the Qlikvew server 12 published dashboard, but Aggr((Sum(charge)/Count(DISTINCT TicketNumber)),Resource) does not work.

2.PNG

View solution in original post