Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
karthikeyan1504
Creator III
Creator III

if else.. issue

Hi,

I have a requirement as briefed below,

Please refer the table below,

account id, description, amount

1, Salary, 100

2, Bonus, 20

from above table I need to build a chart to show the salary & Salary + Bonus trendline. If condition doesn't helps..

Salary = 100

Salary+Bonus = 100 + 20 = 120

Could anyone please help me on this?

Thanks & Regards,

Karthikeyan.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can have Year as dimension.

1st Expression will be Sum(Salary)

2nd Will be Sum(Salary) + Sum(Bonus) Give label as Salary + Bonus

Show them as Line chart and you are done.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

12 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can create an intermediate table like shown below.

account id, description, amount

1, Salary, 100

2, Bonus, 20

description,Display

Salary,Salary+Bonus

Bonus,Salary+Bonus

Link this table in your data model and then use the Display field in dimension to get required output.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Usually, a trendline is time-based. Do you have historical information on Salaries and Bonuses?

Peter

karthikeyan1504
Creator III
Creator III
Author

Yes I do have...

Let me rephrase the table,

Year, account id, description, amount

2009,1, Salary, 100

2010,2, Bonus, 20

2010,1, Salary, 150

2011,2, Bonus, 20

2012,1, Salary, 200

2013,2, Bonus, 20

2014,1, Salary, 250

2015,2, Bonus, 20

karthikeyan1504
Creator III
Creator III
Author

Hi Kaushik,

Thanks for your reply.

In your case it will be as two measures. but i want them into dimensions.

Warm Regards,

Karthikeyan.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Could you tell me what output is expected from the table which you have shown.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
karthikeyan1504
Creator III
Creator III
Author

Capture.PNG

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I guess what you have done is right.

You will need two expression one for sales and other for Sales + Bonus.

If not then please help us to understand with example and sample data.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
karthikeyan1504
Creator III
Creator III
Author

Year & Salary Expense is the dimensions

Amount is the measure

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can have Year as dimension.

1st Expression will be Sum(Salary)

2nd Will be Sum(Salary) + Sum(Bonus) Give label as Salary + Bonus

Show them as Line chart and you are done.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!