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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create column % from other column values

Hello,

I have a calculated expresion in the script to create a new column in my table. The calculate expresion is to obtain only the "Tipo actuacion" which finish in "1":

LOAD if(Right([Tipo actuacion],1)='1',[Tipo actuacion]) as [Notificaciones],

*;

The problem is that when I calculate a % column in a Pivot Table, it takes in consideration the other values (those which don't finish in "1" which appear in blank in the column "Notificaciones"), so the percentages aren't as I want.

Pivot Table.JPG.jpg

Labels (1)
18 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Please send the expression that computes the % and the dimensions of your chart.

rustyfishbones
Master II
Master II

There is no need to use

LOAD if(Right([Tipo actuacion],1)='1',[Tipo actuacion]) as [Notificaciones],

*;

Add Notificaciones as your dimension, and use the following as your expression

SUM({<Notificaciones = {'*1'}>}Cantidad)

and then use relative to get your percentage

tresB
Champion III
Champion III

Use set in your expression like:

Sum({<[Notificaciones]={1}>} YourField) / Sum({<[Notificaciones]={1}>} TOTAL YourField)

Not applicable
Author

I can not use Relative to get the percentage, this is a Pivot Table

Not applicable
Author

The dimensions are both calculated in the script, and are these:

- Notificaciones: if(Right([Tipo actuacion],1)='1',[Tipo actuacion])

- AñoExpediente: RIGHT(LEFT([Nº Expediente],7),4)

The expression that computes the % is:

((Sum(Cantidad))/Aggr(NODISTINCT Sum(Cantidad), [AñoExpediente]))*100

Not applicable
Author

I have tested it but it doesn´t show the percentages in the table...

alexandros17
Partner - Champion III
Partner - Champion III

Try this and let me know


((Sum({$ <Notificaciones={'1'}>} Cantidad))/Aggr(NODISTINCT Sum({$ <Notificaciones={'1'}>}Cantidad), [AñoExpediente]))*100

tresB
Champion III
Champion III

Goto number tab-> enable 'Show in Percent (%)'

Not applicable
Author

It is enable