Qlik Community

Qlik Sense App Development

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

tyember1
New Contributor II

Creating combo chart with two measure calculated by dimension field

Hello Qlik Community,

I have been trying to create a bar chart showing a sum based on the year found in the date field on the record (a 2017 vs 2018 comparison using the same date field and same qty field) my date format is YYYY-MM-DD. My data begins Jan 1st, 2017.

The chart expression I am using is IF(LEFT(End_Date,4) < '2018', sum(Aggr(Sum(Qty),End_Date)))

The expression checker validates it, but It still will not produce any visualization. I have tried loading the date in different format styles but no joy. Is there a different way to use the aggr function to display the measure based on a dimension value? Or should I be loading the date data differently?

Thanks for the help.

Tags (2)
1 Solution

Accepted Solutions
Digvijay_Singh
Honored Contributor III

Re: Creating combo chart with two measure calculated by dimension field

May be something like this -

Dimension - Valuelist('2017','2018')

Measure - Pick(Match(Valuelist('2017','2018'),'2017',2018'),

Sum(If(LEFT(Date,4) = '2017',Qty)),

Sum(If(LEFT(Date,4) = '2018',Qty))

4 Replies

Re: Creating combo chart with two measure calculated by dimension field

May be you need this

Sum(Aggr(Sum({<Date = {"$(='<=' & Date(MakeDate(2018), 'YYYY-MM-DD'))"}>} Qty), Date))

Digvijay_Singh
Honored Contributor III

Re: Creating combo chart with two measure calculated by dimension field

May be something like this -

Dimension - Valuelist('2017','2018')

Measure - Pick(Match(Valuelist('2017','2018'),'2017',2018'),

Sum(If(LEFT(Date,4) = '2017',Qty)),

Sum(If(LEFT(Date,4) = '2018',Qty))

tyember1
New Contributor II

Re: Creating combo chart with two measure calculated by dimension field

I realize now I should not have called my dimension "Date", I updated it to "End_Date" so I could tell the difference between what needs to be the date function and what needs to be my dimension.

tyember1
New Contributor II

Re: Creating combo chart with two measure calculated by dimension field

Thank you! I completely overlooked putting Sum before the IF function.. that solved everything. Thanks again for your help!

Community Browser