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: 
Anonymous
Not applicable

One field selection should get two different values

Hi,

  1. i have a calender script and the field "Year".
  2. I have 2 linecharts. First "Sales", second "Price".
  3. The table for "Sales" has one column "salesYear".
  4. The table for "Price" has one column "priceYear".
  5. I want to put only 1 field into my worksheet to select a year.


How can i make it, that if i select a "Year", that the first linechart "Sales" get the year "salesYear" and the second linechart "Price" get "priceYear"?


regards,

Fritz



1 Solution

Accepted Solutions
sfatoux72
Partner - Specialist
Partner - Specialist

It works in Qlik Sense too:

I add the field year in the expression of the calculated dimension YEAR :  = If(Year = salesYear and Year = priceYear and Year = Year,  Year)

When I select 2015 in the calculated dimension, The three other take automaticly the same value:

2016-02-07 16_51_51-Qlik Sense Desktop.png

But I agree with other, that it would be better to use only one field Year in your model. If it's not possible you have this solution

View solution in original post

12 Replies
sunny_talwar

You can add triggers on Year field to select the same year in the other two fields. the action would be Select in Field

MK_QSL
MVP
MVP

This will help..

Canonical Date

Anonymous
Not applicable
Author

Hi Sunny,

do you have a link to a help site about triggers? I don´t know what triggers are and can´t find anything.

regards,

fritz

brunobertels
Master
Master

Hi

you should link your calendar year with fiels year from table sales and table price :

somethink like that asuming you have year field named "Year" in your calendar :

sales:

load

"sales Year" as Year,

.....

from ...

prices:

load

"prices year" as year,

then just add filter pan with field year and Year as dimension in your chart

hope it helps

Bruno

sunny_talwar

‌my bad.... I didn't notice this was Qlik Sense. You will have to go with the other solutions provided as I don't think there are triggers in Qlik Sense as of now.

ogster1974
Partner - Master II
Partner - Master II

You could also concatenate your Sales and Prices into a single fact table during load with the column Year used for both.  Use Set Analysis to identify the Prices Vs Sales in your measure.

Anonymous
Not applicable
Author

Hi Andy,

do you have an example for it?

regards,

Fritz

Anonymous
Not applicable
Author

If i use this expression in the select field

='(' & priceYear & '|' & salesYear & ')'


It displays:


2016

2015 | 2014

2014 | 2016

etc.


And both years will and each linechart takes the correct year.


But how can i show only:


2014

2015

2016


in the select field?


regards,

Fritz

sfatoux72
Partner - Specialist
Partner - Specialist

Try with this expression :    = If(salesYear = priceYear,  priceYear)

You will show this

2014

2015

2016

And when you will select one value of this calculated field, the corresponding value in salesYear and priceYear will be selected

2016-02-07 10_22_50-QVCxxx.png