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: 
Vince_CH
Creator III
Creator III

Change of dimension label of bar/line chart

Dear All,

I made some line chart as below, with 2019 in fiscal year YTD in the dimension.  I want to make the 2019 looked like '2019 YTD' instead, like red font indicated, and still can be ranked in '2016, 2017,2018, 2019YTD'.  Is there anybody having this experience or advices?? thanks!

11.jpg

Labels (1)
20 Replies
Kalmer
Partner - Creator
Partner - Creator

Is it possible for you to upload the app so i can see it?
If not then could i have the measure and a picture of the data schema. I need to understand how your data is stored and how are those fields interacting. Right now I'm in the dark 😞

Vince_CH
Creator III
Creator III
Author

Okay, I try if I can upload the app this time. thanks

zzyjordan
Creator II
Creator II

Hi, Huichunchang
Sorry about the late response.
Please try this and let me know if it works or not

If(FiscalYear_Entry>='2014',If(FiscalYear_Entry=max(total FiscalYear_Entry),FiscalYear_Entry&' YTD',FiscalYear_Entry))

ZZ

Vince_CH
Creator III
Creator III
Author

@zzyjordan:
thanks, just triked, it indicated invalid dimension then.
I had uploaded the app, you may try it inside it.
thanks a lot.
zzyjordan
Creator II
Creator II

Hi,
I don't have desktop version installed in my PC, could you just attached the data file or the script if it is the inline data load, thx.

ZZ
Vince_CH
Creator III
Creator III
Author

@zzyjordan:

My scripts are like following, and data file is attached.

I am afraid there might be some context setting causing this issue?


SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='¥#,##0.00;-¥#,##0.00';
SET TimeFormat='TTh:mm:ss';
SET DateFormat='YYYY/MM/DD';
SET TimestampFormat='YYYY/MM/DD TTh:mm:ss[.fff]';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='zh-CN';
SET CreateSearchIndexOnReload=1;
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';

SET vFM=7;
SET vMaxFiscalYear_Entry=Max(FiscalYear_Entry);

[Production Plan]:

LOAD
[Sales Order No.],
[Order Category],
[Sales Machine No. Creating Date],
If(Month([Sales Machine No. Creating Date])='Jan'or Month([Sales Machine No. Creating Date])='Feb'or Month([Sales Machine No. Creating Date])='Mar'or Month([Sales Machine No. Creating Date])='Apr'or Month([Sales Machine No. Creating Date])='May'or Month([Sales Machine No. Creating Date])='Jun',Year([Sales Machine No. Creating Date]),(Year([Sales Machine No. Creating Date])+1))as FiscalYear_Entry

FROM [lib://QVD 6/Order_Production Plan_2017_V3.xlsx]
(ooxml, embedded labels, table is Database);

zzyjordan
Creator II
Creator II

Hi, 

Thanks for your detailed script and data file, appreciated. 

I copied your script to load the data file you attached, and copied the expression I sent previously, below is the chart generated without any changes, and it works. So I am not sure what's the problem in your qvf, but I will use my home desktop version to open your qvf when I back to home and see if I could find something.

ZZ

 

Untitled.jpg

Vince_CH
Creator III
Creator III
Author

thanks for your time, yes, it might be some context setting reason which suspected.
zzyjordan
Creator II
Creator II

Hi, Vince

In your qvf file, I just copy the expression and it works, please refer below screenshot.

and I also attached the modified qvf as well.

Let me know if it is still a problem.

ZZ

qlik.JPG

Vince_CH
Creator III
Creator III
Author

@zzyjordan, yes, it works now. I missed deleting one additional "=" so leads to the invalid dimension earlier, thanks a lot