Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
israrkhan
Specialist II
Specialist II

Combo Chart(Trend line for selected Brands)

Hi Guys...

I have a combo chart.where i have one dimension which is Week, and one expression which is sum({1}Sale), display option is Bar.

now i have to show trend line for brands, i have around 50 brands..i want to give option to user to select up to 6 brands and see the trend line for selected brands, out of total sale...

the solution comes in mind is to add  conditional expressions for each Brand...but in this case i have to add around 50 conditional expressions in the chart...

is there any way to do this with minimum expressions...

Many Thanks,,,,

6 Replies
antoniotiman
Master III
Master III

Hi,

I think this is what You want.

Regards,

Antonio

Anonymous
Not applicable

Could you use something like this in 6 expressions for Set Analysis selection  ?

    subfield(GetFieldSelections(Brand),',',1)

Where the 1 will return the first Brand selected and then do the same to 2, 3, 4, 5 & 6.

israrkhan
Specialist II
Specialist II
Author

Thanks for the reply...

but i want to see separate trend line for each selected brand...

if i select 3 brands, then i want to see 3 lines for each selected brands....

israrkhan
Specialist II
Specialist II
Author

Hi Bill,

this expression gives me Brands name in text boxes correctly...

=SUM({<Brand.COMM_NM = {'$(=subfield(GetFieldSelections(Brand.COMM_NM),',',1))'}>} SellOut.QTY)


but when i use this in chart, it does not show line for all selected brands, it show only for last selected brand...

any idea...

Many Thanks



Anonymous
Not applicable

Just noticed there is a leading space that needs trimming away :

=SUM({<Brand.COMM_NM = {'$(=trim(subfield(GetFieldSelections(Brand.COMM_NM),',',1)))'}>} SellOut.QTY)

MK_QSL
MVP
MVP

You need to use many expressions in your application...

something like below.. May be wait for someone with better solution.

For 1st Expression

Conditional

$(=GetSelectedCount(Brand))>=1

Label

='Sales for Brand : '& SubField(GetFieldSelections(Brand,':'),':',1)

Definition

=SUM(TOTAL <YearWeek> {<Brand = {"$(=SubField(GetFieldSelections(Brand,':'),':',1))"}>}Sales)

For 2nd Expression

Conditional

$(=GetSelectedCount(Brand))>=2

Label

='Sales for Brand : '& SubField(GetFieldSelections(Brand,':'),':',2)

Definition

=SUM(TOTAL <YearWeek> {<Brand = {"$(=SubField(GetFieldSelections(Brand,':'),':',2))"}>}Sales)

and so on...