Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ch_riadh
Partner
Partner

Dates

Hi, 

i have 2 tables:

Table1: Field 1 ----> Date

                Field 2 ----> Sales

Table1: Field 1----> EventName

                Field 2 ----> DateFromCY

                Field 3 ----> DateToCY

 

I create 2 Variable :

vStartDateCY    :     =Date(DateFromCY)

vEndDateCY    :     =Date(DateToCY)

 

I want Sales for event period.

expression: Sum({<Date={">=$(vStartDateCY)<=$(vEndDateCY)"}>}Sales) 
Works fine when i select one event.

ev1.PNG

When Clear selection  gives me total sales.  😞

ev2.PNG

I want display Sales per Event.

Thanks

Labels (3)
4 Replies
Vegar
Partner
Partner

Whenever you do dollar expansions in a set expression you should consider the value as it is a variable defined outside of your chart. $(vStartDateCY) will have the same value for all rows in your chart and in your case it will probably be null as I assume you have more than one DateFromCY value in your selection. 

 

Have you considered using IntervalMatch  for modelling your data? 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
ch_riadh
Partner
Partner
Author

hi vegar,

thank you for your response,

so do you have a solution for that ?

Vegar
Partner
Partner

Try to use interval match.

Sales:
LOAD  Date, Sales
FROM SALES;

Event:
LOAD DateFromCY, DateToCY, EventName 
FROM EVENT;

Inner Join IntervalMatch ( Date ) 
LOAD DateFromCY, DateToCY
Resident Event;

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
ch_riadh
Partner
Partner
Author

thank you. it works 

but i have an other issue 😞

Event:
LOAD 
EventName , DateFromCY, DateToCY,
EventNameComp, DateFromComp, DateToComp

FROM Event;

Date:
LOAD Date, Sales

FROM  Date;

 

Inner Join IntervalMatch ( Date)
LOAD


DateFromComp,
DateToComp

Resident Event; 

What about the Event comparable ???