Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Showing Percentage Totals by Year

Hello,

Thank you for taking this question in advance.

Basically, I have data that spans across 4 years (2011, 2012, 2013, 2014). I want to show it by two Dimensions, 'Engaged' which is either a Yes or No, and over each year.

I want the percentages to show 'Y' or 'N' for 100% across EACH year, rather than 100% across all 4 years (which is how it currently shows).

Example: For 2011, I want 'Y' to show for 70% and 'N' to show for 30%, 2012 to show 'Y' for 80% and 'N' to show for 20%, rather than showing all the 'Y' and 'N' 2011 + 2012 + 2013+ 2014 adding up to 100%.

I have attached screen shots below of what the graph currently shows, along with the dimensions and expression.

I really appreciate the help!

Thanks!

25 Replies
saurabh5
Creator II
Creator II

hi Ryan,

you can create a new field in your script-----

if([Audit Firm]='X' or [Audit Firm]='Y' or [Audit Firm]='Z','Others',[Audit Firm])as new firm,

and use this in your 4 expressions you created for the 4 firms.

Regards

Saurabh


sunny_talwar

Do you see any red curly line in the set modifier. Can you paste a snapshot of this particular expression?

Not applicable
Author

Hi Saurabh,

Would this require me to list out every other firm as others? There are hundreds of them so ideally I would like to write and expression that simply amounts to:

If not Firm A, B, C, or D then 'Others'.

Do you know what the actual calculated field would have to be in order to create it within the script?

Thanks!

saurabh5
Creator II
Creator II

if you have only 4 then you can write

if([Audit firm]='A','A',

   if([Audit firm]='B','B',

      if([Audit firm]='C','C',

          if([Audit firm]='D','D', 

                    'Others'   

)))) as newfirm

Not applicable
Author

Yes,

Please see the screen-shot (apologies for the crossed out information, which is sensitive).

Please let me know if this helps

sunny_talwar

I see you replaced e with Other. Try this formula as it is and let me know if it works or not:

=Count({<[Audit Firm]=e({<[Audit Firm] = {'A', 'B', 'C', 'D'}>})>}DISTINCT ID)/Count(distinct ID)