Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
scotly-victor
Creator II
Creator II

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?

8 Replies
sunny_talwar
MVP
MVP

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
Creator II
Creator II
Author

Sorry, still same error

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

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.

sunny_talwar
MVP
MVP

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

scotly-victor
Creator II
Creator II
Author

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

This is my expression

scotly-victor
Creator II
Creator II
Author

Sorry ,Issue still persist

scotly-victor
Creator II
Creator II
Author

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

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

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