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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

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

                                


                                                    

              

                        

31 Replies
perumal_41
Partner - Specialist II
Partner - Specialist II

step by step will do

Step 1 :

count(PRUEFLOS)

/ count(Total  <name1>  PRUEFLOS)

if you get step 1 value then implement 2

Step 2 :

count({$<YEAR=,QUATERS= >}PRUEFLOS)

/count({$<YEAR=,QUATERS=>} Total <name1> PRUEFLOS)

if you get step 2 value then implement 3

Step 3 :

count({$<YEAR=,QUATERS=,Decision= >}PRUEFLOS)

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

if you get step 3 value then implement 4

Step 4 :

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

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

kunkumnaveen
Specialist
Specialist
Author

same thing coming out

kunkumnaveen
Specialist
Specialist
Author

Any suggestion for this requirement will be appreciated 

perumal_41
Partner - Specialist II
Partner - Specialist II

which step ypur getting error ? is possible to upload sample application

kunkumnaveen
Specialist
Specialist
Author

its about 13 MB after reducting  ,i dont think it will get up loaded but still i will try

kunkumnaveen
Specialist
Specialist
Author

Please find the sample file,my requirement is at level2

i mean when u click on summary charts it will bring you  materiel wise    after  selecting material it will bring you to supplier where i need this percentage thing

perumal_41
Partner - Specialist II
Partner - Specialist II

expression working

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

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


snap shot

kunkumnaveen
Specialist
Specialist
Author

HI looks like its working ,if you have done this in my file will u post it back,i will open it in me mate laptop

perumal_41
Partner - Specialist II
Partner - Specialist II

Currently I am also working personal edition . so I am un able to your application. but I took binary load  in to test app and  then tested expression .

kunkumnaveen
Specialist
Specialist
Author

i just copied and pasted your expression ,but still i am getting what you getting,is it possible to send at least the file you worked on plz

thanks