Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

add % column to the pivot table

Hi,

Actually  my problem is i have .qvd file data. data the used to generate the pivot table like this 

monthlostnodecisionwongrandtotal
jan4030373
feb4535484
mar65455115
grandtotal15011012272

but i need this type

monthlostnodecisionwongrandtotalRate%=won/Grandtota
jan4030373won/Grandtotal(3/73)
feb4535484won/Grandtotal(4/84)
mar65455115won/Grandtotal
grandtotal15011012272won/Grandtotal

my using the this expression count({<status={'won'}>}[month])/count(status)

it will generate like this but i need only rate% column after the grand total only

monthlost nodecision won grandtotalRate%
grandtotalRate%grandtotalRate%grandtotalRate%
jan40 30 3 73
feb45 35 4 84
mar65 45 5 115
grandtotal150 110 12 272

any one plz help me urgent......

6 Replies
ecolomer
Master II
Master II

See the file and imagep02.png

Not applicable
Author

sorry I need only the rate%=won/grandtotal only after the grand total column.

please write the script in the discussion form only plz......

jagan
Luminary Alumni
Luminary Alumni

Hi,

Create new expression

Rate % = Sum(won) / (Sum(won)+Sum(lost)+sum(nodecision))

Now in Number tab select Fixed to 1 or 2 (depends on your requirement) and select Show in % option.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

how to calculate won, lost, no decision all are the status column data.

ecolomer
Master II
Master II

Here you have the imagep04.png

p04.png

jagan
Luminary Alumni
Luminary Alumni

Hi,

Attach some sample data and your expected output, without proper info it is difficult to understand and give solution.  If you want to get the count of won, lost, no decision then use count

Won - Count(won)

lost - Count(lost)

NoDecision - Count(Nodecision)

Rate % = Count(won) / (Count(won)+Count(lost)+Count(nodecision))


Hope this helps you.


Regards,

Jagan.