Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

kunkumnaveen
Contributor III

how to write expression for percentage

Hello All,

suppose if i have a table data like this

    supplier     accepted   rejected   exception accepted        total                ENSTEHDAT

      a                  50              25                 25                    100               10/03/2015

       a                100             50                 50                    200               15/004/2015 

     b                   25             25                50                    100               10/03/2015

       b                  50              25                25                    100                15/004/2015 




what my requirement is i want known what percentage of  each supplier lots were accepted,rejected, exception from total for that particular period

i mean suppose i select date range from 01/03/2015 to 01/05/2015,and accepted value from decision field   then i should see

                               


                                                            accepted=   150(50%)    (out of 300)         75(40%)  (out of 200)     

                                                                                        a                                  b


                                                          

    rejected value from decision field rejected= 75(25%)    (out of 300)         50(20%)  (out of 200)     

                                                                                    a                                  b



exception accepted value from decision field exception accepted=   75(25%)    (out of 300)         75(40%)  (out of 200)     

                                                                                                                               a                                  b





so in a bar chart if i take two dimension:1)supplier

                                                           2)decision (as values accepted, rejected ,exception accepted)



                expression   :1)=count({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>total)

                                     2)percentage?

thanks

naveen

                                


                                                    

              

                        

1 Solution

Accepted Solutions
perumal_41
Valued Contributor II

Re: how to write expression for percentage

I can't upload with data . so I am uploading application without data . once downloaded  and change the path Binary load and reload it will works

31 Replies
MVP
MVP

Re: how to write expression for percentage

There is no decision field, so you will need to do this as three expressions:

For accepted:

Count({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>} TOTAL <supplier> accepted) /

      Count({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>} TOTAL <supplier> total)

And do the same for the other two decision values

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sujeetsingh
Honored Contributor III

Re: how to write expression for percentage

Naveen,

Fist of all there is two way when  you say when I select that means the percentage is without any dimension that means you are not distributing the percentage on any dimension. Hence to represent this you need a text box object and quote your expression for each accepted ,rejected and exception .

Now the next thing is to distribute it on supplier    .

Hence it can be a straight table.

sujeetsingh
Honored Contributor III

Re: how to write expression for percentage

See this sample please

kunkumnaveen
Contributor III

Re: how to write expression for percentage

is it possible to write single dynamic expression for three values (accepted,rejected,exception accepted)

because i need to display dimensions 1)supplier

                                                         2)decision

            is it possible by keeping two dimesion and single expression instead of three

kunkumnaveen
Contributor III

Re: how to write expression for percentage

i am showing it in bar chart so i need to show same with two dimensions

                                                          1)supplier

                                                         2)decision

perumal_41
Valued Contributor II

Re: how to write expression for percentage

Hi Navven,

Try below for percentage expr

Sum({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}total)

/Sum({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>} Total total)

kunkumnaveen
Contributor III

Re: how to write expression for percentage

this expression compare and show percentage of only suppliers of that chart,but i need percentage expression which compare between the values of decision filed of same supplier

i mean suppose i select date range from 01/03/2015 to 01/05/2015,and accepted value from decision field   then i should see

                              


                                                            accepted=   150(50%)    (out of 300)         75(40%)  (out of 200)    

                                                                                        a                                  b


                                                         

    rejected value from decision field rejected= 75(25%)    (out of 300)         50(20%)  (out of 200)    

                                                                                    a                                  b



exception accepted value from decision field

exception accepted=   75(25%)    (out of 300)         75(40%)  (out of 200)    

                                             a                                  b

perumal_41
Valued Contributor II

Re: how to write expression for percentage

Now Try

Sum({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}total)

/Sum({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>} Total <[decision filed]>  total)

kunkumnaveen
Contributor III

Re: how to write expression for percentage

hi ,please find the attachment ,with slides,if you see that a supplier called JAY Ganesh Chemicals

for this supplier  i am getting  accepted%=66.7

                                            rejected%=60

                                            exception%=50

                              total              176.7%    but it has to be altogether 100% only

your expression:

      count({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS)

/count({$<YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>} Total <Decision>PRUEFLOS)

Community Browser