Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Calculate percent in line chart - calculated dimension

Hi there,

I need to create a line chart that shows proportional percentages across the chart (i.e. the % should add up to 100)

The calculated dimension is:

=If([Duration]>Time('0:30:00','h:mm:ss'),

  IF([Type]='Type1',Hour([Start Time])))

Expression (returns incorrect value):

count([PrimaryKey]) / count(TOTAL [PrimaryKey])

I tried using set analysis but only suceeded partly. The condition for [Type] works but not for [Duration]:

count([PrimaryKey]) / count(TOTAL {<Type={'Type1'}, [Duration]={">Time('0:15:00','h:mm:ss')"}>} [PrimaryKey])

Appreciate your responses, thanks!

6 Replies
Highlighted

Try it like

count([PrimaryKey])

/

count(TOTAL {<Type={'Type1'}, [Duration]={">$(=Time('0:15:00','h:mm:ss') )" }>} [PrimaryKey])

Regards

Anand

Highlighted

And another one is

count([PrimaryKey])

/

count(TOTAL {<Type={'Type1'}, [Duration]={'>$(=Time('0:15:00','h:mm:ss') )'}>} [PrimaryKey])

Regards

Anand

Highlighted
Master
Master

hi,

Please refer to below post:

http://community.qlik.com/message/156954#156954

Regards

Neetha

Highlighted
Not applicable

Hi Anand,

Thanks for your responses. I tried both methods and even assigned =Time('0:15:00','h:mm:ss') to a variable (hoping that might help). Unfortunately none of the options work. "No data to display" is the message shown on the chart.

Highlighted
Not applicable

Hi Neetha,

I'm using the TOTAL keyword but it doesn't work in my case because I have a calculated dimension. It looks like the person in the link you provided isn't using a calculated dimension.

Maybe I'm missing something?

Thanks.

Highlighted
Master
Master

Hi Aviral,

Please try by creating new expression in expression tab:

count([PrimaryKey])/count(TOTAL {<Type={'Type1'}, [Duration]={'>$(=Time('0:15:00','h:mm:ss') )'}>} [PrimaryKey])

Check relative button (or) Number Tab -  Select fixed option and check show in percent option.

Regards

Neetha