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

Date range in 2 comparison segments

Hi all,

I  am very new to Qlikview. I have 2 segments comparisons in 1 chart, eg, compare different time period.

"Segment1" & "Segment2" are in same design, can allow the user to click and select the fields in several list box.

Let say "Segment1" contain the fields "Product", "Store" and "Date".

but now i want to remove the "Date" selection and create input box for users to input "vStartDate1" and "vEndDate1" for "Segment1"

So how is the expression of sum the "Sales" for "Segment1" with "vStartDate1" and "vEndDate1"?

7 Replies
Anonymous
Not applicable
Author

Hi Ivan


May be try:

= Sum({< Date = {">=$(=Date(vStartDate,'DD/MM/YYYY'))<=$(=Date(vEndDate,'DD/MM/YYYY'))"} >} Sales)

Regards

Neetha

Not applicable
Author

Hi Neetha,

Thanks. But may be I make the question more clearly.

I have 2 segments to compare in a chart with 2 lines: "Segment1" & "Segment2"

What is the expression fro Line1 : Sum of sales ("Segment1", with "vStartDate1" and "vEndDate1)

and What is the expression fro Line2 : Sum of sales ("Segment2", with "vStartDate2" and "vEndDate2)


"Segment1" and "Segment2" contain the fields "Product", "Store" etc...

Thanks,

Ivan Chung

Anonymous
Not applicable
Author

Hi Ivan,


what are the fields we need to compare these variables with(vStartDate1 ,vEndDate1, vStartDate2 and vEndDate2) in set analysis?

Regards

Neetha

Not applicable
Author

Well, those fields are "Store", "Product". Let say I can compare ProductA, Store01, from 3-May-2015 to 7-Jun-2015 and ProductC, Store13, from 22-Apr-2015 to 10-May-2015. Thanks

sasiparupudi1
Master III
Master III

Hi

What do you mean by segments? alternate states?

Please clarify

Sasi

Not applicable
Author

Hi Sasi,

Yes. 2 alternate states.

Thanks.

Ivan Chung

Not applicable
Author

so is it ?


= Sum({< Date = {">=$(=Date(vStartDate1,'DD/MM/YYYY'))<=$(=Date(vEndDate1,'DD/MM/YYYY'))"} ,{[Segment1]}>} Sales)

&

= Sum({< Date = {">=$(=Date(vStartDate2,'DD/MM/YYYY'))<=$(=Date(vEndDate2,'DD/MM/YYYY'))"} ,{[Segment2]}>} Sales)


but seem wrong...


Anyone can help?