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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
waqasshah
Creator
Creator

Percentage Issue in If Else Condition

Hi Guys,

I am trying to calculate the percentage value if specific criteria meets. I don't know why If Else condition is not working . . The charts will be my proposed output. Please review the attached screenshots. Please help.

Kind Regards

Waqas Shah

18 Replies
waqasshah
Creator
Creator
Author

Yes That's is correct. Please note at a time on screen we show only one Speciality like surgery  25% in 2017/2018 and surgery 2018/2019 is 33.33 %.  please review screenshot for desired output (just sample).. how it can be achieved in qlikview?

timpoismans
Specialist
Specialist

Hi Waqas

It depends how you want to show one specialty.

1) You can do it through selection, thus using the measure with financial year as a dimension and the specialty selected in a listbox.

Percentage Issue_3.PNG

2) You can make a separate graph for a specialty and use set analysis to choose which specialty.

Do note that the second method is static.

waqasshah
Creator
Creator
Author

Many Thanks are you using set Analysis?

Can you please upload the qvd file?

regards

Waqas Shah

timpoismans
Specialist
Specialist

In the above screenshot, I am simple making use of a bar graph and a selection field of Specialty.

No use of Set Analysis.

I'm afraid I can't share the example file, as I'm using Qlik Sense (.qvf file vs .qvw file)

The solution works on QlikView and Qlik Sense though.

Steps to undertake:

  1. Create a selection field of Specialty.
  2. Make a bar graph
    1. Dimension is Financial Year
    2. Measure is: Sum(DNA)/Sum(total<DNASpecialty,[Financial Year]>DNATotal)
  3. Finished.

You can now use the selection field to switch between the specialties.

If your issue is resolved, please mark the correct answer and/or any helpful answers. Thanks.

waqasshah
Creator
Creator
Author

it works. Many Thanks for your help. Really Appreciated.

timpoismans
Specialist
Specialist

You're welcome!

waqasshah
Creator
Creator
Author

Apologise again but the following expression you write is not set analysis ?

Sum(DNA)/Sum(total<DNASpecialty,[Financial Year]>DNATotal)

what you called it then? because it has different brackets like <> ??

timpoismans
Specialist
Specialist

No worries Waqas.

total<DNASpecialty,[Financial Year]>

is not Set Analysis, it's the total function used in a calculation.

Set Analysis is marked such as the following (in bold):

Sum({<Specialty={'Surgery'}>}DNA)

This measure would give me the sum of DNA where the Specialty = Surgery.

waqasshah
Creator
Creator
Author

ok Got It many Thanks