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: 
fanninam
Creator
Creator

Expression hard code

I would like to write an expression for a line graph that does the following:

When Year 2017 is selected make Jan = 11400, Feb = 11400, Mar = 11400, Apr = 11400, May = 11400, Jun = 11400, Jul = 11400, Aug = 11400, Sep = 11400, Oct = 11400, Nov = 11400, Dec = 11400

6 Replies
sergio0592
Specialist III
Specialist III

Try to add : if(GetFieldSelections(Year)=2017,11400) in Presentation/References lines

vishsaggi
Champion III
Champion III

May be something like this?

What is that 11400 just a hardcoded value or a value coming from a expression field.

If month is your dimension.

You can just write

= IF(Year = '2017', 11400, Sum(yourvaluefield))

ahaahaaha
Partner - Master
Partner - Master

Hi Amber,

May be as  a variant.

We believe that the autoCalendar has  linked fields Date, Month and Year. Furhter add script code

Table2017:

Load*Inline

[Month2017, Vol2017

Jan, 11400

Feb, 11400

Mar, 11400

Apr, 11400

May, 11400

Jun, 11400

Jul, 11400

Aug, 11400

Oct, 11400

Nov, 11400

Dec, 11400];

We create a chart with dimension Month2017  and expression Vol2017

1.jpg

Finally, we specify the condition for calculating the expression

2.jpg

Regards,

Andrey

sumitjadhav
Creator II
Creator II

can you share the dummy data, as we can understand there is just 2017 for the selection or any other years. if we create a inline table of year=2017 and month from Jan-Dec and mention the amount 11400 in form of it then it will give you the data required.

sales.JPG

fanninam
Creator
Creator
Author

Jean,

My graph toggles from month to quarter.  I tried this and it does work well but when I toggle from month to quarter the amount stays 11400 instead of becoming a quarterly amount.

fanninam
Creator
Creator
Author

11400 is just a hardcoded value.  My dimension is a cyclical group that toggles from month to quarter.  The main issue I am running into is when I toggle from month to quarter the 11400 does not change to a quarterly amount.