Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

scotly-victor
Contributor

conditional dimension in line chart

Hi all ,

I have conditional dimension in line chart.

If(DateTemp1 = 'YTD',FiscalMonth,

if(DateTemp1 = 'QTD',FiscalMonth,

IF(DateTemp1='MTD',[Day (#)],

IF(DateTemp1='WTD',[Day (#)]))))

I have list box with YTD,QTD,MTD,WTD .

When I select YTD ,QTD    no issue, Fiscal Month displays.

When I select MTD,WTD Output would be like this

fiscal month.png

can anyone help?

Tags (1)
8 Replies
MVP
MVP

Re: conditional dimension in line chart

What happens if the order of the if statement is changed?


IF(DateTemp1='MTD',[Day (#)],

IF(DateTemp1='WTD',[Day (#)],

IF(DateTemp1='YTD',FiscalMonth,

IF(DateTemp1='QTD',FiscalMonth))))

scotly-victor
Contributor

Re: conditional dimension in line chart

Sorry, still same error

phaneendra_kunc
Valued Contributor III

Re: conditional dimension in line chart

How did you define your DAY #?

If(DateTemp1 = 'YTD',FiscalMonth,

if(DateTemp1 = 'QTD',FiscalMonth,

IF(DateTemp1='MTD',Date([Day (#)],'DD'),

IF(DateTemp1='WTD',Date([Day (#)],'DD'))))

if above doesn't work convert your Day # in this format in script.

Text((Date(Today(),'DD'))) as [Day (#)]

Replace "Today()" with your field from datamodel.

MVP
MVP

Re: conditional dimension in line chart

Would you be able to share the data behind this dimensions? I will give it a try to test it out

scotly-victor
Contributor

Re: conditional dimension in line chart

sum({<type={'Order'},FiscalYear={$(=max(FiscalYear))} >} Sales)

This is my expression

scotly-victor
Contributor

Re: conditional dimension in line chart

Sorry ,Issue still persist

scotly-victor
Contributor

Re: conditional dimension in line chart

I have used list box for selection YTD,QTD,MTD,WTD(INLINE CODE)

phaneendra_kunc
Valued Contributor III

Re: conditional dimension in line chart

Can you share you QVF with us? Above approaches should work, unless we are missing something here.