Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
maxtromb
Contributor
Contributor

Display values on line chart

Hi everybody,

I have a line chart with an x-axis time series (which is updated every month with the latest information) and an y-axis with sales values.

The user can select the shop for viewing line chart of its sales value during the month.

Furthermore, each store is associated with events such as openings of competitors whose date is expressed in months like sales values.

I want to show these events with a symbol placed in the month in which it happened at the sales level (plus a million not to overlap the line) of the store of that month.

With this function:

=if(inmonth([DATA IMPATTO],Data,0)=-1,sum(Vendite_AM)+1000000)

where:

DATA IMPATTO is the date of the event (month)

Data is the date of the sales values (month)

Vendite_AM is the sales values

I can display the symbol only if there is a singol event.

line graph qv.gif

If I have more than one event associated to one shop I cannot display anything on the graph, just the line.

How can I do it?

11 Replies
Anil_Babu_Samineni

Not sure, I understand this?

=if(inmonth([DATA IMPATTO],Data,0)=-1,sum(Vendite_AM)+1000000)

where:

DATA IMPATTO is the date of the event (month)

Data is the date of the sales values (month)

Vendite_AM is the sales values

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

If I have more than one event associated to one shop I cannot display anything on the graph, just the line.

So, if you have more than one event, you would not want to show it on the chart? I think it should be possible, would you be able to share a sample of what you have so far?

jonathandienst
Partner - Champion III
Partner - Champion III

Perhaps I am mistaken, but I suspect that DATA IMPATTO is not properly associated with Data in the fact table, so if more than one value exists, it is ambiguous and nothing will be displayed. I would perform the InMonth() in the load script and append the event to the main fact table with an event flag field (such as EvFlag = 0 or 1). Then the expression can simplify to

     =(Sum(Vendite_AM) +1E6) *EvFlag

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
maxtromb
Contributor
Contributor
Author

No no, I want to display all the events associated to one shop.

The graph I posted at the beginning of the discussion (watch 1st image below) is the case where one shop has only one event associated.

line graph qv.gif

If I select I shop that has more than one event, I cannot display anything:

line graph qv2.gif

In the second case I would display 4 triangles.

maxtromb
Contributor
Contributor
Author

I think the dates are actually associated correctly ('MMM - YY') because the formula works when the value is unique.

With your function, how can I display the symbol at the right level of my x-axis (time series in month)?


maxtromb
Contributor
Contributor
Author

yeah, correct:

in the first line I copy my function/formula

In 3rd, 4th and 5th line I explain the variables contained in the formula for give you more clearness

sunny_talwar

Would you be able to attach a sample to check out what might be going on?

maxtromb
Contributor
Contributor
Author

I want to see 4 triangles for 4 events.

Now I can see 1 triangle only if I have 1 event.

If I have 2 or more events I cannot see anything,

Immagine1.jpg

Anonymous
Not applicable

Dual(If(DATA IMPATTO=Max(DATA IMPATTO),Data, ''),Sum(Vendite_AM))


or



Dual(If(Data=Max(Data), DATA IMPATTO, ''),Sum(Vendite_AM))