Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
danosoft
Specialist
Specialist

Bar Chart with columns table

Hi i am in this situation:  i have a table with those columns:

gen_consumo_mensile,feb_consumo_mensile, mar_consumo_mensile,apr_consumo_mensile,mag_consumo_mensile,giu_consumo_mensile, lug_consumo_mensile, ago_consumo_mensile, set_consumo_mensile, ott_consumo_mensile,nov_consumo_mensile,dic_consumo_mensile

Are 12 columns

I want to make a bar chart with, in the dimension i have months (gen,feb, mar,apr,may, jun,jul,ago,sep,oct,nov,dec) and in the bar the sum of those columns (for JAN i want the sum of GEN_CONSUMO_MENSILE, for FEB i want the sum of FEB_CONSUMO_MENSILE, for MAR i want the sum of MAR_CONSUMO_MENSILE.... and so on till for DEC the sum of DIC_CONSUMO_MENSILE.

How can i do that?

27 Replies
uacg0009
Partner - Specialist
Partner - Specialist

you need to load again, becuase i can't load.

chinnuchinni
Creator III
Creator III

can you post the expected output please ?

danosoft
Specialist
Specialist
Author

Hi Praveen, your script is really near to the solution, is all ok, only the total i expected must be:

for Example select 2017 year, i expect those total in the chart :

gen_consumo_mensile = 1374

feb_consumo_mensile = 1035

mar_consumo_mensile = 907

apr_consumo_mensile = 594

and so on....

chinnuchinni
Creator III
Creator III

try this:

expression:


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Jan',/*sum(GEN_CONSUMO_MENSILE)*/Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}GEN_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Feb',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}FEB_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Mar',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}MAR_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Apr',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}APR_CONSUMO_MENSILE),



if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'May',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}MAG_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Jun',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}GIU_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Jly',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}LUG_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Aug',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}AGO_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Sep',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}SET_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Oct',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}OTT_CONSUMO_MENSILE),


if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Nov',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}NOV_CONSUMO_MENSILE),




if(ValueList('Jan','Feb','Mar','Apr','May','Jun','Jly','Aug','Sep','Oct','Nov','Dec')= 'Dec',Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN"}>}DIC_CONSUMO_MENSILE)





))))))))))))


sample123.PNG




danosoft
Specialist
Specialist
Author

Great Praveen thanks!!! It's work.....

only a last question

how can i show when i go on the chart only the number of my value?

becouse now i see all the expression = value, not only the value of my expression

thanks

Or, you can send me the exmple you did? becouse in your picture i see you see only the value, not all the code expression

chinnuchinni
Creator III
Creator III

!find the attachment

danosoft
Specialist
Specialist
Author

Thanks, but in the popup i not see only the value (for example 1035 in this case)

is possible to see only the value?

chinnuchinni
Creator III
Creator III

Give the dimension name as Month,in dimension tab.

see below snap:

legend Name.PNG

sample test1.PNG