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: 
ankit777
Specialist
Specialist

Conditionally creating a line chart.

Hi All,

I have a table.

CategoryPointScoreDate
Northa7March 20, 2014
Northa6March 21, 2014
Northa5March 22, 2014
Northb7March 20, 2014
Northb9March 21 2014
Northb4March 22 2014
Southc3March 20, 2014
Southc5March 21 2014
Southc7March 22 2014
Southd8March 20 2014
Southd9March 21 2014
Southd7March 22 2014

I want to create a line chart in which I want to show the date wise score of all the point in a particular category when user selects that category. For example

If user selects North, he should see the trend for point a and b in the line chart.

If user selects South, he should see the trend for point c and d in the same chart.

Please help.

Thanks

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

8 Replies
MK_QSL
MVP
MVP

Like this?

Gysbert_Wassenaar

I'm not sure what you mean by trendlines. Are those simply the lines themselves or the lines you get when you enable for example the linear option under Trendlines (on the Expressions tab). See attached example


talk is cheap, supply exceeds demand
ankit777
Specialist
Specialist
Author

Hi Manish,

Thanks for your reply. It exactly meets my requirement. But can you explain why are you using sum function?

ankit777
Specialist
Specialist
Author

HI,

The chart you provided is correct. Please explain the use of sum() function.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

If there are many values for a particular combination of dimension then it will result you in "Null". If use sum around that field name then it will add up and show you the consolidated value for that combination.

jagan
Luminary Alumni
Luminary Alumni

Hi Ankit,

You need to use Aggregate functions like Sum, Count etc in Expressions to the get value by the dimensions.   For single date and point you have multiple scores, if you want to get by  Date and Point then you have to use Sum(Score) and use the dimensions date and point.  Sum() is similar to Group by in SQL

SELECT

date,

point,

Sum(score)

FROM TableName

Group By date, point;

Hop this helps you.

Regards,

Jagan.

ankit777
Specialist
Specialist
Author

Thanks everyone.

MK_QSL
MVP
MVP

SUM is used considering the possibilities that there could be more than one different score for same category, point and date combination...