Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar Chart

Hi,

I have data in below format:

Member Var1  Var2  Var3  Var4  Var5  Var6  Var7  Var8  Var9  Var10

a            0.70   0.14   0.09  0.74   0.17   0.33   0.71  0.15   0.01  0.65

b            0.88   0.14   0.84  0.70   0.92   0.43  0.05   0.48   0.91  0.90

c            0.05    0.49   0.89  0.58  0.64   0.65   0.13   0.31  0.75  0.67

d            0.59   0.71   0.10   0.57  0.35   0.63   0.93  0.20   0.65  0.45

I want to display above data in a bar chart where X-axis should show me Var1 Var2 and so on and each bar for the variables should be the count of values greater than 0.50. e.g. Bar for Var1 would have a count of 3 and Bar for Var2 would have count of 1

Is this possible?

Thanks in advance

Abhinav

5 Replies
Not applicable
Author

Hi Abhinav

Try to transform your data using CrossTable() function first. Then creating your chart is going to be fairly easy

Lukasz

sujeetsingh
Master III
Master III

Post a sample or explain in more words

jonathandienst
Partner - Champion III
Partner - Champion III

Load like this:

CrossTable(Var, Value)

LOAD Member,

     Var1,

     Var2,

     ...

     Var10

FROM ...;

Create chart with dimension Var and expression

     =Sum({<Value = {">0.5"}>} Value)

HTH

Jonathan

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

This should work for you. In the script:

CrossTable(Var, Value)

LOAD Member,

     Var1,

     Var2,

     Var3,

     Var4,

     Var5,

     Var6,

     Var7,

     Var8,

     Var9,

     Var10

FROM yoursource.qvd (qvd);

As a result for this script, you will get a table like:

Member     Var     Value

a               Var1    0.70

a               Var2    0.14

a               Var3    0.09

......

Then, create a barchar object with Var as dimension and =Count({<Value = {">0.5"}>} Value) as expression.

Hope that helps.

Luis

Not applicable
Author

Thank you everyone.