Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

kunkumnaveen
Contributor III

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
Contributor III

Re: how to write dynamic expression

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

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

Re: how to write dynamic expression

Hi,

Try this

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

kunkumnaveen
Contributor III

Re: how to write dynamic expression

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

MVP
MVP

Re: how to write dynamic expression

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
MVP
MVP

Re: how to write dynamic expression

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
MVP
MVP

Re: how to write dynamic expression

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

Re: how to write dynamic expression

Could you post expected output for the above data.?

kunkumnaveen
Contributor III

Re: how to write dynamic expression

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
Contributor III

Re: how to write dynamic expression

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

Community Browser