Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

% Formatting defined in script not working in pivot table

Hello

I ham defining my % expression in the script and referring to the value in a pivot table

 

My expression is:

num(sum(if(ED_Did_Not_Wait=1,1,0))/sum(InYTDInd), '0,0%' )


I have used this format in numerous tables before it it gives me an output of I.e. 3.45%

However when I load the script, the value in my pivot table comes out as 0.345124315315315313 and I want to show 3.45%

I have defined the format in my script also:

 

SET Percentage = '0.0%'

NB: In my pivot table, I also have values in a hh:mm format.  Can I have more than 1 value type in a pivot table?

Does anyone have any suggestions as to why my % is not showing the desired format?

Kind Regards

Helen

6 Replies
miguelbraga
Partner - Specialist III
Partner - Specialist III

Try to change your expression to this please:

=num(sum(if(ED_Did_Not_Wait=1,1,0))/sum(InYTDInd), '# ##0,00%' )

Maybe this could solve your problem

Kushal_Chawda

Use the expression

sum(if(ED_Did_Not_Wait=1,1,0))/sum(InYTDInd)


Now got to Number tab of Pivot table properties -> change Number Format setting , select Fixed to -> Select 2 Decimal-> check the show in Percent(%)

Not applicable


Try This Format


=num(sum(if(ED_Did_Not_Wait=1,1,0))/sum(InYTDInd), '#,##0.00%' )

Hope its HelpFull To you

helen_pip
Creator III
Creator III
Author

Hello

Thank you for your response

I managed to get the % to show by writing the expression as

  num(sum(if(ED_Did_Not_Wait=1,1,0))/sum(InYTDInd), '0.00%')

However, I only got it to work by taking out all other expressions.  All other expressions in my pivot table are in hh:mm format and as I am defining the format in the script, it appears that the pivot table will on ly accept 1 formatting type.

I wanted to do as much work for the pivot table in the script, but am now thinking of doing the formatting in the table itself.

Have you heard of pivot tables only showing 1 type of formatting when all is defined in the script?

Kind Regards

Helen


helen_pip
Creator III
Creator III
Author

Hello

Thank you for your response

I managed to get the % to show by writing the expression as

  num(sum(if(ED_Did_Not_Wait=1,1,0))/sum(InYTDInd), '0.00%')

However, I only got it to work by taking out all other expressions.  All other expressions in my pivot table are in hh:mm format and as I am defining the format in the script, it appears that the pivot table will on ly accept 1 formatting type.

I wanted to do as much work for the pivot table in the script, but am now thinking of doing the formatting in the table itself. 

Have you heard of pivot tables only showing 1 type of formatting when all is defined in the script?

Kind Regards

Helen


Not applicable

Try this Expression it will work

num((sum(if(ED_Did_Not_Wait=1,1,0))/sum(InYTDInd)), '##.00 %')