Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

kumarreddy257
Contributor

100% stacked bar chart

Hi,

I want to create a 100% stacked bar chart with below four expressions and one date column.

1)   SUM({<[Campaign Channel]={'PPC'},[Geography Country]={'usa'}>}[Site Visit Vis Num])

2)   SUM({<[Campaign Channel]={'Direct load'},[Geography Country]={'usa'}>}[Site Visit Vis Num])

3)   SUM({<[Campaign Channel]={'Natural Search'},[Geography Country]={'usa'}>}[Site Visit Vis Num])

4)   SUM({<[Campaign Channel]={'Referring Sites'},[Geography Country]={'usa'}>}[Site Visit Vis Num])

and above is my requirement. Pls help me on this issue

Regards,

Kumar

5 Replies
sushil353
Honored Contributor II

Re: 100% stacked bar chart

Hi,

Try to divide each expression by SUM(total <Day> [Site Visit Vis Num])

for example.

SUM({<[Campaign Channel]={'PPC'},[Geography Country]={'usa'}>}[Site Visit Vis Num]) / SUM(total <Day> [Site Visit Vis Num])

HTH
Sushil

kumarreddy257
Contributor

Re: 100% stacked bar chart

Hi,

As u said I tried like this, but expression is throwing error. I am trying to convert the date column into DD/MM/YYYY format

SUM(TOTAL(date([Time Full Date],'DD/MM/YYYY'))[Site Visit Vis Num]). Anything wrong in this expression.

Regards,

Kumar

Not applicable

Re: 100% stacked bar chart

Hi,

You can try this expression and In style tab click on stacked button.

SUM({<[Campaign Channel]={'PPC','Direct load','Natural Search','Referring Sites'},[Geography Country]={'usa'}>}[Site Visit Vis Num])

MVP
MVP

Re: 100% stacked bar chart

Hi

Why would you be summing the date? The best place to format the date is when loading, but in this case you could also use a calculated dimension:

     =Date([Time Full Date], 'DD/MM/YYYY')

For the bars, Sushil's suggestion looks correct to me. If you are getting an error with this, please be a lot more specific about the error, or post a sample illustrating the problem.

HTH

Jonathan

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

Re: 100% stacked bar chart

Do u want me write for four expressions like the same way. I have four expressions

Community Browser