Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

how to write dynamic expression

Hello all , if i have a sample data like ,how to write a dynamics expression

category  decision      material  lot

smelting    accepted      spix      10

smelting      rejected        spix      20

smelting      exception      spix      30

mining          accepted      hydra      25

mining          rejected        hydra    35

mining        exception      hydra      45

so i need a dynamic  expression :   category={smelting},decision={accepted } and that particular material lot     =       10     in percentage

                                                  category={smelting}   total lot                                                                            (10+20+30)

thanks

naveen

11 Replies
kunkumnaveen
Specialist
Specialist
Author

  category={smelting},decision={accepted } and that particular material lot    =      10        in percentage           

category={smelting}  total lot                                                                      (10+20+30)

tamilarasu
Champion
Champion

Hi,

Try this

=Num(Sum({<[category]={'smelting'},[decision]={'accepted'}>}lot) / Sum(Total {<category={'smelting'}>}lot), '#,##0.00%')

kunkumnaveen
Specialist
Specialist
Author

dude i need dynamic expression...see that category and decision  fields i need dynamic ,

what i mean is those fields has to change based up on user selection ,,i just wrote like that for better understanding purpose

jonathandienst
Partner - Champion III
Partner - Champion III

Like this perhaps (assuming that this is in a text box or similar undimensioned location):

Sum({<category = {'smelting'}, decision = {'accepted'}>} lot) / Sum({<category = {'smelting'}>} lot)

How do you want to use user selections?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

If you mean let the user select a category, then use:

     Sum({<decision = {'accepted'}>} lot) / Sum(lot)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

If you mean the user will select both fields:

    Sum({<category = P(category), decision = P(decision)>} lot) / Sum({<category = P(category)>} lot)

    Sum({<category = P(category), decision = P(decision)>} lot) / Sum({<category = P(category), decision>} lot)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tamilarasu
Champion
Champion

Could you post expected output for the above data.?

kunkumnaveen
Specialist
Specialist
Author

I am showing this requirement in combo chart  

Sum({<category = {'smelting'}, decision = {'accepted'}>} lot) / Sum({<category = {'smelting'}>} lot)

can this expression be a dynamic

Sum({<category = {''}, decision = {''}>} lot) / Sum({<category = {''}>} lot)

those category should change based up on user selection i mean so time it may be smelting or mining or -----------(i got 10 diff values in that filed)
and the same with decision field ..i need that also dynamic
i
kunkumnaveen
Specialist
Specialist
Author

user will select both category and decision  then it will bring to other chart(combo chart) there material will be dimesion...