Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem with Only function

Hi community,

I have a trouble using only function in a chart expression. My dimension is dimension1, and my expression is like:

=sum({<flag={'1'}, dimension2={'$=(Only(dimension1))'}>} Sales)

dimension1 and dimension2 are same format, result of MonthName function in script.

I tried with ' and " and without them, but still not working.

I'd appreciate any help. Thanks.

Marc.

14 Replies
MK_QSL
MVP
MVP

Try

=sum({<flag={'1'}, dimension2={"=dimension2 = dimension1"}>} Sales)

Anonymous
Not applicable
Author

Thanks Manish, but it works only for one unique value selected in dimension1.

MK_QSL
MVP
MVP

Provide few lines of sample data.. may be 5-6 enough

Anonymous
Not applicable
Author

Manish, PFA.

I've excluded flag dimension to make it easy.

Marc

MK_QSL
MVP
MVP

Create a Chart

Dimension

Dimension1

Expression

SUM(IF(dimension1 = dimension2,Sales))

Anonymous
Not applicable
Author

Yes, it works here but it is not going fine with the other conditions in the set analysis. Tomorrow I will prepare another sample data with more info and fields to analize it deeper.

Thanks a lot, Manish.

Marc.

Anonymous
Not applicable
Author

Manish,

PFA.

The white background zone is the expected value (linked to an alternate estate). Total in left table for november 2014 should match the value in the right side.

Thanks.

MK_QSL
MVP
MVP

I am finding difficulties to understand due to field name... Could you please create a sample excel file with expected output?

Anonymous
Not applicable
Author

Sorry Manish. I've renamed field. You could see expected output for november 2014 in the table added in the right side.

Thanks.