Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to fetch data in a chart from different fields

Hi all,

I need to create a bar chart with month as the dimension, for that i hav values in diffrent fields lik jan month data,feb mnth data,etc.. based on different customers.in my chart i want to display for a particular mnth the 'value' for specific dealers.

1 Solution

Accepted Solutions
Not applicable
Author

Hi

Pls Load the script.Hope it will work.

RawData:LOAD customer,
    
customer_id,
    
Zone,
    
jan_value,     Feb_value,      Mar_value,      April_value,
    
May_value

FROM[dummy data.xlsx](ooxml, embedded labels, table is Sheet1);

DataTemp:CrossTable(MonthID,Value,3)LOAD *
    
Resident RawData;
    
DROP Table RawData;
        
Data:
LOAD customer,      customer_id,      Zone,
    
Left(MonthID,3) As Month,
    
Value    
     
Resident DataTemp;     DROP Table DataTemp;

Dummy Data.JPG

Regards-Bika

View solution in original post

3 Replies
Not applicable
Author

Hi

Pls Load the script.Hope it will work.

RawData:LOAD customer,
    
customer_id,
    
Zone,
    
jan_value,     Feb_value,      Mar_value,      April_value,
    
May_value

FROM[dummy data.xlsx](ooxml, embedded labels, table is Sheet1);

DataTemp:CrossTable(MonthID,Value,3)LOAD *
    
Resident RawData;
    
DROP Table RawData;
        
Data:
LOAD customer,      customer_id,      Zone,
    
Left(MonthID,3) As Month,
    
Value    
     
Resident DataTemp;     DROP Table DataTemp;

Dummy Data.JPG

Regards-Bika

narender123
Specialist
Specialist

Hi Reena,

You need to make cross table.

example:

load          //your original table

customer ,

customer_id,

zone,

jan,

feb,

march

from abc;

new1:

crosstable(month,value,3)

customer ,

customer_id,

zone,

jan,

feb,

march

resident abc;

drop table abc;

now in new1 table

month field heaning (jan,feb,march) and value field  heaving (that are in month field)

in your expression ,now you can take the dimention as month and calculation expression via value field.

Thanks

Narender

Not applicable
Author

Thanks..it works...