Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
LE2
Contributor
Contributor

calculate a new column based on existing ones

I have three columns with numeric values with a date column:

A, B, C, Date

1, 3, 2, 2021-01-01

2, 1, 2, 2021-01-01

1, 2, 1, 2021-01-03

I just need to calculate a new column for each row: A+B+C 

A+B+C

6

5

5

And I want to draw a line chart with Date as x-axis, to show the value of accumulated A+B+C until the date.

Should I add a new measure? or a new dimension? How should I set the chart measure?

 

Also, is it possible to create a parameter in Qlik Sense? 

Labels (3)
4 Replies
Vegar
MVP
MVP

Get your desired field by adding the three together in a new field.

 

Load *, A+B+C as [A B C]

Inline [

A, B, C, Date

1, 3, 2, 2021-01-01

2, 1, 2, 2021-01-01

1, 2, 1, 2021-01-03];

The easiest way to get accumulated total in Qlik Sense is to use  a sum ([A B C]) in your chart expression and then choose a modifier that does a full acumulation. Take a look at this video on how to do that. https://youtu.be/Sd4e4cuNwq8

 

Please explain what you mean by "create a parameter in Qlik Sense".

Taoufiq_Zarra

@LE2 

you can use for example Date as x-axis and Rangesum(A,B,C) as measure

Taoufiq_Zarra_0-1644997032506.png

 

for parameter yes in Qliksense you can use variable

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
LE2
Contributor
Contributor
Author

Thank you, the video helps me to do accumulation.

But, do you mean sum ([A]+[B]+[C]) ? cuz sum ([A B C]) is called error in expression.

Say, if I create a measure using the above expression, does it mean i will have a new column with values (A+B+C) for each row?

LE2
Contributor
Contributor
Author

I tried to use a drop down variable input component to control values of the variable. And I created a dimension using following expression:

ps- variable name :matches, existing date dimension name: obs

 

=if(matches='yearly',[obs.autoCalendar.Year],

 if(matches='quarterly',[obs.autoCalendar.YearQuarter],

[obs.autoCalendar.YearMonth]))

 

I want to use this new dimension as my dynamic x-axis of charts.

However, with the variable input cell changing, the dimension is not changing. Can you help me with this?